context-free-grammar
linear grammar with unequal number of 0s and 1s
Is it possible to come up with a linear grammar with unequal number of 0s and 1s? Su开发者_StackOverflow中文版ch as 0100, 01100, 111,1,0, 100101001...[详细]
2023-04-11 17:39 分类:问答How do I find the language from a regular expression?
How would I find the language for the following regular expressions over the alphabet {a, b}? aUb* (ab*Uc)[详细]
2023-04-10 08:55 分类:问答How to build parse tree?
Have found C++ BNF and there next lines selection-statement: if ( condition ) statement if ( condition ) statement else statement[详细]
2023-04-09 13:01 分类:问答How to parse comments with EBNF grammars
When defining the grammar for a language parser, how do you deal with things like comments (eg /* .... */) that can occur at any point in the text?[详细]
2023-04-08 23:41 分类:问答A grammar that accepts the empty set by the rule S->S
This was a homework assignment problem which I know I have incorrectly answered.I gave: S -> \'\' meaning that S yields the empty string.I know that the empty set and empty string are not the sa[详细]
2023-04-07 11:32 分类:问答Need help constructing a deterministic finite automata?
What are the rules for constructing a deterministic finite automata in the form of a diagram? My professor explained by 开发者_如何学JAVAexamples, but I am not exactly sure what rules must be followed[详细]
2023-04-07 04:56 分类:问答Tips for writing good EBNF grammars
I\'m wri开发者_开发问答ting some Extended Backus–Naur Form grammars for document parsing. There are lots of excellent guides for the syntax of these definitions, but very little online about how to d[详细]
2023-04-06 20:03 分类:问答Composing data-structures/strings matching a CFG
The JSON syntax is an example of a CFG (Context free grammar). Va开发者_JS百科lid JSON strings are a sequence of tokens constrained to a CFG... or, the tokens can -equivalently- be thought of as a st[详细]
2023-04-05 15:40 分类:问答How do you convert the following ambiguous grammar to unambiguous?
I understand how the difference between the two, how ambiguity means that t开发者_如何学Gohere is at least one string with 2 distinct parse trees while there is only one in an unambiguous tree. But I[详细]
2023-04-05 13:18 分类:问答Need help constructing a grammar?
L = ((a^n)(b^n+m)(a^m)) | n, m = 0, 1, 2...) I\'m new to context free grammar and know the basics, but I\'ve been struggling with this for a while.[详细]
2023-04-04 12:54 分类:问答