📄 lalr.txt
字号:
program → .declaration-list <font color='green'># </font><br>^program → declaration-list . <font color='green'># </font><br>program → declaration-list . <font color='green'># </font><br>declaration-list → declaration-list .declaration <font color='green'>int void bool # </font><br>^declaration-list → declaration . <font color='green'>int void bool # </font><br>^declaration → var-declaration . <font color='green'># int void bool </font><br>^var-declaration → type-specifier .ID ; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>var-declaration → type-specifier .ID ; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>var-declaration → type-specifier .ID [ NUM ] ; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>var-declaration → type-specifier .ID ; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>var-declaration → type-specifier .ID [ NUM ] ; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>fun-declaration → type-specifier .ID N ( params ) compound-stmt <font color='green'># int void bool </font><br>^type-specifier → int . <font color='green'>ID # int void bool ! - ( NUM true false ; { if while return , </font><br>^type-specifier → void . <font color='green'>ID # int void bool ! - ( NUM true false ; { if while return , </font><br>^type-specifier → bool . <font color='green'>ID # int void bool ! - ( NUM true false ; { if while return , </font><br>^declaration → fun-declaration . <font color='green'># int void bool </font><br>^declaration-list → declaration-list declaration . <font color='green'>int void bool # </font><br>^var-declaration → type-specifier ID .; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>var-declaration → type-specifier ID .; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>var-declaration → type-specifier ID .[ NUM ] ; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>var-declaration → type-specifier ID .; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>var-declaration → type-specifier ID .[ NUM ] ; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>fun-declaration → type-specifier ID .N ( params ) compound-stmt <font color='green'># int void bool </font><br>^var-declaration → type-specifier ID ; . <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>^var-declaration → type-specifier ID [ .NUM ] ; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>^fun-declaration → type-specifier ID N .( params ) compound-stmt <font color='green'># int void bool </font><br>^var-declaration → type-specifier ID [ NUM .] ; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>^fun-declaration → type-specifier ID N ( .params ) compound-stmt <font color='green'># int void bool </font><br>^var-declaration → type-specifier ID [ NUM ] .; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>^fun-declaration → type-specifier ID N ( params .) compound-stmt <font color='green'># int void bool </font><br>^params → param-list . <font color='green'>) </font><br>params → param-list . <font color='green'>) </font><br>param-list → param-list ., param <font color='green'>, </font><br>^param-list → param . <font color='green'>, </font><br>^param → type-specifier .ID <font color='green'>, </font><br>param → type-specifier .ID <font color='green'>, </font><br>param → type-specifier .ID [ ] <font color='green'>, </font><br>^type-specifier → void . <font color='green'>ID int void bool ! - ( NUM true false ; { if while return # </font><br>type-specifier → void . <font color='green'>ID int void bool ! - ( NUM true false ; { if while return # </font><br>params → void . <font color='green'>) </font><br>^var-declaration → type-specifier ID [ NUM ] ; . <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>^fun-declaration → type-specifier ID N ( params ) .compound-stmt <font color='green'># int void bool </font><br>^param-list → param-list , .param <font color='green'>, </font><br>^param → type-specifier ID . <font color='green'>, </font><br>param → type-specifier ID . <font color='green'>, </font><br>param → type-specifier ID .[ ] <font color='green'>, </font><br>^fun-declaration → type-specifier ID N ( params ) compound-stmt . <font color='green'># int void bool </font><br>^compound-stmt → { .local-declarations statement-list } <font color='green'>ID ! - ( NUM true false ; { if while return } # int void bool </font><br>^param-list → param-list , param . <font color='green'>, </font><br>^param → type-specifier ID [ .] <font color='green'>, </font><br>^compound-stmt → { local-declarations .statement-list } <font color='green'>ID ! - ( NUM true false ; { if while return } # int void bool </font><br>compound-stmt → { local-declarations .statement-list } <font color='green'>ID ! - ( NUM true false ; { if while return } # int void bool </font><br>local-declarations → local-declarations .var-declaration <font color='green'>int void bool ID ! - ( NUM true false ; { if while return </font><br>^param → type-specifier ID [ ] . <font color='green'>, </font><br>^compound-stmt → { local-declarations statement-list .} <font color='green'>ID ! - ( NUM true false ; { if while return } # int void bool </font><br>compound-stmt → { local-declarations statement-list .} <font color='green'>ID ! - ( NUM true false ; { if while return } # int void bool </font><br>statement-list → statement-list .statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^local-declarations → local-declarations var-declaration . <font color='green'>int void bool ID ! - ( NUM true false ; { if while return </font><br>^var-declaration → type-specifier .ID ; <font color='green'>int void bool ID ! - ( NUM true false ; { if while return # </font><br>var-declaration → type-specifier .ID ; <font color='green'>int void bool ID ! - ( NUM true false ; { if while return # </font><br>var-declaration → type-specifier .ID [ NUM ] ; <font color='green'>int void bool ID ! - ( NUM true false ; { if while return # </font><br>^compound-stmt → { local-declarations statement-list } . <font color='green'>ID ! - ( NUM true false ; { if while return } # int void bool </font><br>^statement-list → statement-list statement . <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^statement → expression-stmt . <font color='green'>else ID ! - ( NUM true false ; { if while return } </font><br>^expression-stmt → expression .; <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^expression → var .= expression <font color='green'>; ) ] ID ! - ( NUM true false { if while return } , </font><br>expression → var .= expression <font color='green'>; ) ] ID ! - ( NUM true false { if while return } , </font><br>factor → var . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^var → ID . <font color='green'>= ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>var → ID . <font color='green'>= ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>var → ID .[ expression ] <font color='green'>= ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>var → ID . <font color='green'>= ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>var → ID .[ expression ] <font color='green'>= ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>call → ID .( args ) <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^expression → simple-expression . <font color='green'>; ) ] ID ! - ( NUM true false { if while return } , </font><br>^simple-expression → additive-expression .relop additive-expression <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] , </font><br>simple-expression → additive-expression .relop additive-expression <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] , </font><br>additive-expression → additive-expression .addop term <font color='green'>+ - || | <= < > >= == != ID ! ( NUM true false ; { if while return } ) ] , </font><br>simple-expression → additive-expression .relop additive-expression <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] , </font><br>additive-expression → additive-expression .addop term <font color='green'>+ - || | <= < > >= == != ID ! ( NUM true false ; { if while return } ) ] , </font><br>simple-expression → additive-expression . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] , </font><br>^additive-expression → term . <font color='green'>+ - || | <= < > >= == != ID ! ( NUM true false ; { if while return } ) ] , </font><br>additive-expression → term . <font color='green'>+ - || | <= < > >= == != ID ! ( NUM true false ; { if while return } ) ] , </font><br>term → term .mulop unary-expression <font color='green'>* / % && ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != , </font><br>^term → unary-expression . <font color='green'>* / % && ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != , </font><br>^unary-expression → unaryop .unary-expression <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^unaryop → ! . <font color='green'>( ID NUM true false ! - ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^unaryop → - . <font color='green'>( ID NUM true false ! - ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^unary-expression → factor . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^factor → ( .expression ) <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^factor → call . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^factor → constant . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^constant → NUM . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^constant → true . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^constant → false . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^expression-stmt → ; . <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^statement → compound-stmt . <font color='green'>else ID ! - ( NUM true false ; { if while return } </font><br>^statement → selection-stmt . <font color='green'>else ID ! - ( NUM true false ; { if while return } </font><br>^selection-stmt → if .( expression ) statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>selection-stmt → if .( expression ) statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>selection-stmt → if .( expression ) statement else statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^statement → iteration-stmt . <font color='green'>else ID ! - ( NUM true false ; { if while return } </font><br>^iteration-stmt → while .( expression ) statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^statement → return-stmt . <font color='green'>else ID ! - ( NUM true false ; { if while return } </font><br>^return-stmt → return .; <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>return-stmt → return .; <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>return-stmt → return .expression ; <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^var-declaration → type-specifier ID .; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>var-declaration → type-specifier ID .; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>var-declaration → type-specifier ID .[ NUM ] ; <font color='green'># int void bool ID ! - ( NUM true false ; { if while return </font><br>^expression-stmt → expression ; . <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^expression → var = .expression <font color='green'>; ) ] ID ! - ( NUM true false { if while return } , </font><br>^var → ID [ .expression ] <font color='green'>= ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^call → ID ( .args ) <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^simple-expression → additive-expression relop .additive-expression <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] , </font><br>^additive-expression → additive-expression addop .term <font color='green'>+ - || | <= < > >= == != ID ! ( NUM true false ; { if while return } ) ] , </font><br>^relop → <= . <font color='green'>! - ( ID NUM true false </font><br>^relop → < . <font color='green'>! - ( ID NUM true false </font><br>^relop → > . <font color='green'>! - ( ID NUM true false </font><br>^relop → >= . <font color='green'>! - ( ID NUM true false </font><br>^relop → == . <font color='green'>! - ( ID NUM true false </font><br>^relop → != . <font color='green'>! - ( ID NUM true false </font><br>^addop → + . <font color='green'>! - ( ID NUM true false </font><br>^addop → - . <font color='green'>! - ( ID NUM true false </font><br>^addop → || . <font color='green'>! - ( ID NUM true false </font><br>^addop → | . <font color='green'>! - ( ID NUM true false </font><br>^term → term mulop .unary-expression <font color='green'>* / % && ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != , </font><br>^mulop → * . <font color='green'>! - ( ID NUM true false </font><br>^mulop → / . <font color='green'>! - ( ID NUM true false </font><br>^mulop → % . <font color='green'>! - ( ID NUM true false </font><br>^mulop → && . <font color='green'>! - ( ID NUM true false </font><br>^unary-expression → unaryop unary-expression . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^factor → var . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^factor → ( expression .) <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^selection-stmt → if ( .expression ) statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>selection-stmt → if ( .expression ) statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>selection-stmt → if ( .expression ) statement else statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^iteration-stmt → while ( .expression ) statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^return-stmt → return ; . <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^return-stmt → return expression .; <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^expression → var = expression . <font color='green'>; ) ] ID ! - ( NUM true false { if while return } , </font><br>^var → ID [ expression .] <font color='green'>= ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^call → ID ( args .) <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^args → arg-list . <font color='green'>) </font><br>args → arg-list . <font color='green'>) </font><br>arg-list → arg-list ., expression <font color='green'>, </font><br>^arg-list → expression . <font color='green'>, </font><br>^simple-expression → additive-expression relop additive-expression . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] , </font><br>simple-expression → additive-expression relop additive-expression . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] , </font><br>additive-expression → additive-expression .addop term <font color='green'>+ - || | <= < > >= == != ID ! ( NUM true false ; { if while return } ) ] , </font><br>^additive-expression → additive-expression addop term . <font color='green'>+ - || | <= < > >= == != ID ! ( NUM true false ; { if while return } ) ] , </font><br>additive-expression → additive-expression addop term . <font color='green'>+ - || | <= < > >= == != ID ! ( NUM true false ; { if while return } ) ] , </font><br>term → term .mulop unary-expression <font color='green'>* / % && ID ! - ( NUM true false ; { if while return } ) ] , + || | <= < > >= == != </font><br>^term → term mulop unary-expression . <font color='green'>* / % && ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != , </font><br>^factor → ( expression ) . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^selection-stmt → if ( expression .) statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>selection-stmt → if ( expression .) statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>selection-stmt → if ( expression .) statement else statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^iteration-stmt → while ( expression .) statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^return-stmt → return expression ; . <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^var → ID [ expression ] . <font color='green'>= ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^call → ID ( args ) . <font color='green'>ID ! - ( NUM true false ; { if while return } ) ] + || | <= < > >= == != * / % && , </font><br>^arg-list → arg-list , .expression <font color='green'>, </font><br>^selection-stmt → if ( expression ) .statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>selection-stmt → if ( expression ) .statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>selection-stmt → if ( expression ) .statement else statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^iteration-stmt → while ( expression ) .statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^arg-list → arg-list , expression . <font color='green'>, </font><br>^selection-stmt → if ( expression ) statement . <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>selection-stmt → if ( expression ) statement . <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>selection-stmt → if ( expression ) statement .else statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^iteration-stmt → while ( expression ) statement . <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^selection-stmt → if ( expression ) statement else .statement <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^selection-stmt → if ( expression ) statement else statement . <font color='green'>ID ! - ( NUM true false ; { if while return } </font><br>^
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -