Skip to content

Commit

Permalink
Update hocc grammar documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Evans committed Aug 21, 2024
1 parent 1313434 commit b4f3074
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bootstrap/bin/hocc/Parse.hmh
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ include hocc
| token_:CIDENT ->
let CIDENT {token_} = token_ in
CodeToken {token_}
| token_:"_"->
| token_:"_" ->
let USCORE {token_} = token_ in
CodeToken {token_}
| token_:ISTRING ->
Expand Down
28 changes: 12 additions & 16 deletions doc/tools/hocc.md
Original file line number Diff line number Diff line change
Expand Up @@ -965,45 +965,41 @@ hocc
# End of input, used to terminate start symbols
token EOI
nonterm Uident ::= UIDENT
nonterm Cident ::= CIDENT
nonterm Ident ::= Uident | Cident | "_"
nonterm Ident ::= UIDENT | CIDENT | "_"
nonterm PrecsTl ::=
| "," Uident PrecsTl
| "," UIDENT PrecsTl
| epsilon
nonterm Precs ::= Uident PrecsTl
nonterm Precs ::= UIDENT PrecsTl
nonterm PrecRels ::=
| "<" Precs
| epsilon
nonterm PrecType ::= "neutral" | "left" | "right"
nonterm Prec ::= PrecType Uident PrecRels
nonterm Prec ::= PrecType UIDENT PrecRels
nonterm SymbolTypeQualifier ::=
| CIDENT "." SymbolTypeQualifier
| epsilon
nonterm OfSymbolType ::= "of" SymbolTypeQualifier UIDENT
nonterm SymbolType ::= "of" SymbolTypeQualifier UIDENT
nonterm OfSymbolType0 ::=
| OfSymbolType
nonterm SymbolType0 ::=
| SymbolType
| epsilon
nonterm PrecRef ::=
| "prec" Uident
| "prec" UIDENT
| epsilon
nonterm TokenAlias ::=
| ISTRING
| epsilon
nonterm Token ::= "token" Cident TokenAlias OfSymbolType0 PrecRef
nonterm Token ::= "token" CIDENT TokenAlias SymbolType0 PrecRef
nonterm Sep ::= LINE_DELIM | ";" | "|"
Expand Down Expand Up @@ -1048,7 +1044,7 @@ hocc
| CodeToken CodeTl
nonterm ProdParamSymbol ::=
| Cident
| CIDENT
| ISTRING
nonterm ProdParam ::=
Expand Down Expand Up @@ -1087,8 +1083,8 @@ hocc
nonterm NontermType ::= "nonterm" | "start"
nonterm Nonterm ::=
| NontermType Cident PrecRef "::=" Prods
| NontermType Cident OfSymbolType PrecRef "::=" Reductions
| NontermType CIDENT PrecRef "::=" Prods
| NontermType CIDENT SymbolType PrecRef "::=" Reductions
nonterm Stmt ::=
| Prec
Expand Down

0 comments on commit b4f3074

Please sign in to comment.