File: ebnf-yac.el.html
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
This is part of ebnf2ps package.
This package defines a parser for Yacc/Bison.
See ebnf2ps.el for documentation.
Yacc/Bison Syntax
-----------------
YACC = { YACC-Definitions }* "%%" { YACC-Rule }* [ "%%" [ YACC-Code ] ].
YACC-Definitions = ( "%token" | "%left" | "%right" | "%nonassoc" )
[ "<" Name ">" ] Name-List
| "%prec" Name
| "any other Yacc definition"
.
YACC-Code = "any C definition".
YACC-Rule = Name ":" Alternative ";".
Alternative = { Sequence || "|" }*.
Sequence = { Factor }*.
Factor = Name
| "'" "character" "'"
| "error"
| "{" "C like commands" "}"
.
Name-List = { Name || "," }*.
Name = "[A-Za-z][A-Za-z0-9_.]*".
Comment = "/*" "any character, but the sequence \\"*/\"" "*/"
| "//" "any character, but the newline \\"\\n\"" "\\\\n".
In other words, a valid Name begins with a letter (upper or lower case)
followed by letters, decimal digits, underscore (_) or point (.). For
example: this_is_a_valid.name, Another_EXAMPLE, mIxEd.CaSe.
Acknowledgments
---------------
Thanks to Matthew K. Junker <junker@alum.mit.edu> for the suggestion to deal with %right, %left and %prec pragmas. His suggestion was extended to deal with %nonassoc pragma too.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Defined variables (5)
ebnf-yac-error | Non-nil means "error" occurred. |
ebnf-yac-lex | Value returned by ‘ebnf-yac-lex’ function. |
ebnf-yac-skip-char | Non-nil means skip printable characters with no grammatical meaning. |
ebnf-yac-token-list | List of ‘%TOKEN’ names. |
ebnf-yac-token-table | Vector used to map characters to a lexical token. |
Defined functions (7)
ebnf-yac-definitions | (TOKEN) |
ebnf-yac-factor | (TOKEN) |
ebnf-yac-initialize | () |
ebnf-yac-lex | () |
ebnf-yac-name-list | (TOKEN) |
ebnf-yac-parser | (START) |
ebnf-yac-rule | (TOKEN) |