Top "Context-free-grammar" questions

In formal language theory, a context-free grammar (CFG) is a grammar subject to a special constraint: that the left-hand side (LHS) consist of a single non-terminal symbol.

Synthesized vs Inherited Attributes

How can I find if an attribute is synthesized or inherited from the productions of a grammar? I guess for …

parsing compiler-construction abstract-syntax-tree context-free-grammar semantic-analysis
How to define a grammar for a programming language

How to define a grammar (context-free) for a new programming language (imperative programming language) that you want to design from …

compiler-construction programming-languages grammar context-free-grammar
Converting grammar to Chomsky Normal Form?

Convert the grammar below into Chomsky Normal Form. Give all the intermediate steps. S -> AB | aB A -&…

grammar context-free-grammar chomsky-normal-form
Context-free grammar for C

I'm working on a parser for C. I'm trying to find a list of all of the context-free derivations for …

c context-free-grammar bnf
Step by step elimination of this indirect left recursion

I've seen this algorithm one should be able to use to remove all left recursion. Yet I'm running into problems …

parsing context-free-grammar left-recursion
What is the difference between LALR and LR parsing?

I understand both LR and LALR are bottom-up parsing algorithms, but what's the difference between the two? What's the difference …

parsing compiler-construction context-free-grammar lalr lr
Context free grammar for non-palindrome

I need a CFG which will generate strings other than palindromes. The solution has been provided and is as below.(…

context-free-grammar computation-theory
Is there a standard C++ grammar?

Does the standard specify the official C++ grammar? I searched, but did not find it anywhere. Also, I wish to …

c++ standards grammar context-free-grammar chomsky-hierarchy
LR(1) Item DFA - Computing Lookaheads

I have trouble understanding how to compute the lookaheads for the LR(1)-items. Lets say that I have this grammar: …

parsing context-free-grammar lookahead dfa lr