Top "Grammar" questions

A formal grammar is a set of production rules that describe how to form strings of valid syntax.

How to identify whether a grammar is LL(1), LR(0) or SLR(1)?

How do you identify whether a grammar is LL(1), LR(0), or SLR(1)? Can anyone please explain it using this example, …

parsing grammar lr ll
What is the difference between LR, SLR, and LALR parsers?

What is the actual difference between LR, SLR, and LALR parsers? I know that SLR and LALR are types of …

algorithm parsing compiler-construction grammar
Tips for creating "Context Free Grammar"

I am new to CFG's, Can someone give me tips in creating CFG that generates some language For example L = {…

grammar context-free-grammar lexical-analysis formal-languages
Converting ambiguous grammar to unambiguous

I did not understand how a unambiguous grammar is derived from a ambiguous grammar? Consider the example on site: Example. …

grammar context-free-grammar
How to check whether a sentence is correct (simple grammar check in Python)?

How to check whether a sentence is valid in Python? Examples: I love Stackoverflow - Correct I Stackoverflow love - …

python nlp grammar
Is C++ context-free or context-sensitive?

I often hear claims that C++ is a context-sensitive language. Take the following example: a b(c); Is this a …

c++ syntax grammar context-free-grammar context-sensitive-grammar
Left-Linear and Right-Linear Grammars

I need help with constructing a left-linear and right-linear grammar for the languages below? a) (0+1)*00(0+1)* b) 0*(1(0+1))* c) (((01+10)*11)*00)* For a) I …

grammar regular-language computation-theory formal-languages
Examples of LL(1), LR(1), LR(0), LALR(1) grammars?

Is there a good resource online with a collection of grammars for some of the major parsing algorithms (LL(1), LR(1), …

parsing grammar lalr lr ll
if statement in R can only have one line?

I was trying a tiny code with if statement, although it is very simple,but there is something I really …

r if-statement grammar
Context-free grammars versus context-sensitive grammars?

Can someone explain to me why grammars [context-free grammar and context-sensitive grammar] of this kind accepts a String? What I …

algorithm parsing grammar context-free-grammar context-sensitive-grammar