From b4f307466b159e96b31b5863a71073563b3d59ca Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Wed, 21 Aug 2024 10:52:46 -0700 Subject: [PATCH] Update hocc grammar documentation --- bootstrap/bin/hocc/Parse.hmh | 2 +- doc/tools/hocc.md | 28 ++++++++++++---------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/bootstrap/bin/hocc/Parse.hmh b/bootstrap/bin/hocc/Parse.hmh index d968e939..b9fc340f 100644 --- a/bootstrap/bin/hocc/Parse.hmh +++ b/bootstrap/bin/hocc/Parse.hmh @@ -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 -> diff --git a/doc/tools/hocc.md b/doc/tools/hocc.md index 7eaaba5a..0cdda2ae 100644 --- a/doc/tools/hocc.md +++ b/doc/tools/hocc.md @@ -965,17 +965,13 @@ 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 @@ -983,27 +979,27 @@ hocc 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 | ";" | "|" @@ -1048,7 +1044,7 @@ hocc | CodeToken CodeTl nonterm ProdParamSymbol ::= - | Cident + | CIDENT | ISTRING nonterm ProdParam ::= @@ -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