Browsable YACC Grammar

CC-BY

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

Summary

Syntax

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

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []