compiler construction - Ambiguous grammar in parse phase -


i want build compiler own language, wrote grammar , finished lexer phase question in parse phase part of ebnf grammer

       statement      →     block | assignment | callstatement | declaration |                              inputstatement |outputstatement | ifstatement | whilestatement         callstatement  →     identifier { /[expression/] }  {. identifier } /( arguments /)         lefthand       →     identifier { /[expression/] }  {. identifier { /[expression/] } } 

i use recursive descent parser method , problem distinguish between callstatement , lefthand ,how should solve ,i apologize if can't explain idea :(


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -