?? test2.txt
字號:
%token ID NUM ASC MARK PREC
/* 關鍵字 */
%token START TOKEN UNION LCURL RCURL LEFT RIGHT NONASSOC TYPE
%%
spec : defines MARK rules tail
;
tail : MARK eat_up_rest
| // empty
;
defines: // empty
| START ID defines
| UNION eat_up_union defines
| LCURL eat_up_defs RCURL defines
| TOKEN symtype nlist
| LEFT symtype nlist
| RIGHT symtype nlist
| NONASSOC symtype nlist
| TYPE symtype nlist2
;
eat_up_defs:
/* Call the function eat_up_def() to copy
the C declare to output file.*/
;
eat_up_union:
/* Call the function eat_up_union()to copy
the union declear to output file.*/
;
eat_up_symtype:
/* Call the function eat_up_symtype() to
copy between '<' to '>' into symbol's
symtype field.*/
;
eat_up_rest:
/* Call function eat_up_rest() to copy the
rest of the Grammar file into output file.
*/
;
symtype: /* empty */
| '<' eat_up_symtype '>'
;
nlist : factor
| factor nlist
| factor ',' nlist
;
factor: ID
| ID NUM
| ASC
| ASC NUM
;
nlist2 : factor2
| factor2 nlist2
| factor2 ',' nlist2
;
factor2: ID
| ASC
;
rules : ID ':' rbodys ';' rules
| /* empty */
;
rbodys: '|' rbody prec rbodys
| ID rbody prec rbodys
| ASC rbody prec rbodys
| '{' rbody prec rbodys
| PREC prec rbodys /* 處理由 %prec 指定優先級的空產生式.*/
| ';' /* 處理分號前邊可能產生的空產生式*/
;
rbody : /* empty */
| ID rbody
| ASC rbody
| '{' eat_act '}' /* common action*/
| '{' eat_act '}' ID rbody /* panel action */
| '{' eat_act '}' ASC rbody /* panel action */
| '{' eat_act '}' '{' rbody /* panel action */
;
prec : /* empty */
| PREC ID
| PREC ID '{' eat_act '}'
;
eat_act:
// empty
;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -