1203 have poor automata

Source: Internet
Author: User

#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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.