#include <stdio.h> #define MAX 100typedef struct//construct an adjacency table for storing nfa{char name;Char Line[max];}node; void Tran () {//conversion operation dedicated to statement} void automata (char r[],int i) {int j = 0;int n = i;While (r[j]! = ' # ') {if (r[i] = = ' (') {printf ("//here is to do the" () "in the string in the text of the initial conversion, recursive decomposition");//Here is to do a "()" in the string in the initial conversion of the sentence, to perform recursive decomposition }else if (r[i] = = ' | ') {printf ("//here is to divide A and B two state nodes into statement 1 | Statement 2 divided into two links ");//In this case, divide a and B two state nodes into statement 1 | Statement 2 divided into two links }else if (r[i] = = ' * ') {printf ("///Here is a self-looping of the previous state node. ");//In this case, the previous state node is self-looping. }else{//Perform a general conversion here. printf ("//For general conversions here"); }j + +; }} void Main () {Char R[max];int i=0;printf ("Please enter normal type to convert: \ n");While (r[i-1]! = ' # ') {scanf ("%c", &r[i]);i++; }automata (r,i); Used to convert a regular type. }
1203 have poor automata