Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: §wip/metasyntax/yacc-sdf/extracted
Source used for this grammar: Paul Klint, YACC.sdf
, 28 March 2007
Grammar
, Yacc-declarations
, Yacc-declaration
, Grammar-rules
, Rule
, Expression
), 1 root (Grammar
), 0 top (—), 7 bottom (Terminal
4, String
, C-code
, Extra-C-code
, Literal
2, NonTerminal
2, C-declarations
).Grammar ::= C-declarations Yacc-declarations "%%" Grammar-rules "%%" Extra-C-code
Yacc-declarations ::=
Yacc-declaration
Yacc-declaration ::= "%token""%left""%right""%nonassoc" Terminal Literal String "%start" Terminal
Grammar-rules ::=
Rule
Rule ::= NonTerminal ":" Expression "|" Expression ";"
Expression ::=
Terminal
NonTerminal
Literal
"%prec" Terminal
C-code
Expression Expression