正在加载图片...
LL(1)Parser input buffer our string to be parsed.We will assume that its end is marked with a special symbol $ output a production rule representing a step of the derivation sequence(left-most derivation)of the string in the input buffer. stack contains the grammar symbols at the bottom of the stack,there is a special end marker symbol $ initially the stack contains only the symbol and the starting symbol S. $S←initial stack when the stack is emptied(ie.only left in the stack),the parsing is completed. parsing table a two-dimensional array M[A,a] each row is a non-terminal symbol each column is a terminal symbol or the special symbol -each entry holds a production rule. CS308 Compiler Theory 11LL(1) Parser input buffer – our string to be parsed We will assume that its end is marked with a special symbol $ our string to be parsed. We will assume that its end is marked with a special symbol $. output – a production rule representing a step of the derivation sequence (left-most derivation) of the string in the input buffer. stack – contains the grammar symbols contains the grammar symbols – at the bottom of the stack, there is a special end marker symbol $. – initially the stack contains only the symbol $ and the starting symbol S. $S Í initial stack – when the stack is emp ( y ), p g p tied (ie. only $ left in the stack), the parsing is completed. parsing table – a two-dimensional array M[A,a] – each i rows a non-termi l bl na symbol – each column is a terminal symbol or the special symbol $ – each entry holds a production rule. CS308 Compiler Theory 11
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有