context-free-grammar
Need a simple Bison grammar for HTML
I\'ve looked at the Bison help and have written this, but I\'m not sure it\'s completely correct. Also i need an yylex() that handle Lexical Analyzer (It should be Flex tool). I know some basic things[详细]
2023-02-06 18:23 分类:问答Unambiguous grammar for arithmetic expressions with no redundant parenthesis
I am looking for an unambiguous grammar for arithmetic expressions with no redundant parentheses. For example, parentheses are redundant in id+(id*id), but not in (开发者_如何学JAVAid+id)*id.You can e[详细]
2023-02-03 08:22 分类:问答Context-free grammar and Reversal
I\'m designing a context-free grammar to generate this language:开发者_开发问答 { w in {a,b}* | w is of the form uvu^R, where u and v are any strings in {a,b}* }[详细]
2023-01-31 18:00 分类:问答Polynomial size CFG such that each terminal in a word occurs even number of times (large alphabet)
Find a context-free grammar (CFG) for the language L of all words such that each terminal in a word occurs even number of times over a possibly large alphabet Σ[详细]
2023-01-30 12:58 分类:问答Removing Left Recursion with Terminals
How do I remove left recursion on the following rule: S -> aSAbb | aA I understand how to perfor开发者_如何学Gom it on S -> SA | A[详细]
2023-01-30 09:08 分类:问答Context free grammar- theory of computation
I am studying for my finals & I was reading context free grammars article from wikipedia and came across following example.[详细]
2023-01-29 21:48 分类:问答Why is bottom-up parsing more common than top-down parsing?
It seems that recursive-descent parsers are not only the simplest to explain, but also the simplest to design and maintain. They aren\'t limited to LALR(1) grammars, and the code itself can be underst[详细]
2023-01-28 17:36 分类:问答Program to convert context free language to push down automata?
I can\'t find any applet or program online to convert a context free language into a push down automata... any help would be gre开发者_StackOverflow中文版atly appreciated.It is very easy to do by hand[详细]
2023-01-27 17:48 分类:问答How to write a square bracket in prolog?
This may sound strange, but it is used in a parser, I want to be able to parse something of the form foo[bar][详细]
2023-01-24 02:50 分类:问答Pumping Lemma in context-free languages
A = {0^a 1^b 2^c | a &开发者_运维技巧lt; b < c} I need to show that A is not context-free. I\'m guessing I have to use the Pumping Lemma for this, but how?The goal is to prove that for any string[详细]
2023-01-23 05:54 分类:问答