/* $Id$ * * This is LL(1) grammar for grammars used in LFC based on the "Introduction to * LFC Programming Language" (January 25, 2008) by Zhen Lixiao */ %token LANG RANG %token LBRACKET RBRACKET %token TO VBAR TILDA %token BLANK %token IDENTIFIER STRING %% grammar : /*empty*/ | production grammar_rest ; grammar_rest : /*empty*/ | BLANK grammar ; production : ordinary_production | non_token_production ; ordinary_production : LANG IDENTIFIER RANG TO terms ; non_token_production : LBRACKET IDENTIFIER RBRACKET TO terms ; terms : term terms_rest ; terms_rest : /*empty*/ | VBAR terms ; term : item item_rest ; item_rest : /*empty*/ | term ; item : TILDA | LANG IDENTIFIER RANG | STRING ;