/* rfpllgr.g */ /* This file contains the LL(1) grammar that is actually used in */ /* the Refal Plus compiler written by R.F.Gurin & S.A.Romanenko. */ /* The annotated version of this grammar (contained in the file */ /* "rfpllgr.f") was produced by executing the command: */ /* gr.exe rfpllgr.g >rfpllgr.f */ %token EXTERNAL ENTRY %token SC COL COL_CURL COMMA EQL %token LPAR RPAR %token LANGU RANGU %token LCURL RCURL %token VAR %token CHAR WORD NUMB %% program : /* empty */ | EXTERNAL extern_defs SC program | func_def maybe_sc program ; maybe_sc : /* empty */ | SC ; extern_defs : name COMMA extern_defs | /* empty */ ; func_def : name block | ENTRY name block ; block : LCURL sentences RCURL ; sentences : /* empty */ | sentence sentences2 ; sentences2 : /* empty */ | SC sentences ; sentence : exp conditions ; conditions : COMMA exp conditions2 | EQL exp ; conditions2 : COL exp conditions | COL_CURL block ; exp : /* empty */ | exp_head exp ; exp_head : static_symbol | LPAR exp RPAR | VAR | LANGU name exp RANGU ; static_symbol : CHAR | WORD | NUMB ; name : WORD ;