lalr

Are C# and Java Grammars LALR(x)?

妖精的绣舞 提交于 2019-11-26 20:36:41
问题 I wonder if C# and Java grammars are LALR(x)? If yes, what's the value of x? Edit: After accepting the true answer, I think it is better to change the Q in this way: Is there any LALR(x) parser that could parse current releases of Java (version 7) or C# (version 4)? If yes, what is the value of x? 回答1: You can't ask this question without first designating a specific grammar for a langauge, as some grammars may be, and some may not. Perhaps you mean the Java grammar as published in recent Java

Is C#'s lambda expression grammar LALR(1)?

余生长醉 提交于 2019-11-26 20:31:17
问题 The question I wish to ask is succintly given in the title. Let me give an example of the grammar in question: identifier_list : identifier | identifier_list identifier; lambda_arguments : '(' identifier_list ')' | identifier; lambda : lambda_arguments '=>' expression Then we add in the normal C expression grammar- particularly, primary_expression : '(' expression ')' | identifier | lambda; The real question is, is this grammar LALR(1) parsable, i.e., capable of being parsed by automated