NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
51.37k stars 5.85k forks source link

Grammar railroad diagram #3237

Closed mingodad closed 3 years ago

mingodad commented 3 years ago

Using this tool https://www.bottlecaps.de/convert/ we can see a railroad diagram for the grammar in Ghidra/Features/Base/src/main/javacc/ghidra/app/util/cparser/C/C.jj copy and paste the EBNF shown bellow on https://www.bottlecaps.de/rr/ui in the tab Edit Grammar then switching to the tab View Diagram.

/*
From https://raw.githubusercontent.com/NationalSecurityAgency/ghidra/master/Ghidra/Features/Base/src/main/javacc/ghidra/app/util/cparser/C/C.jj
*/

/* converted on Mon Jul 19, 2021, 13:02 (UTC+02) by javacc-to-w3c v0.53 which is Copyright (c) 2011-2021 by Gunther Rademacher <grd@gmx.net> */

TranslationUnit
         ::= ExternalDeclaration+
ExternalDeclaration
         ::= FunctionDefinition
           | Declaration
           | PragmaSpec
           | LineDef
           | ';'
LineDef  ::= ( '#line' | LINEALT ) LINENUMBER_LITERAL PATH_LITERAL INTEGER_LITERAL*
ObjcDef  ::= OBJC_IDENTIFIER ( OBJC_IDENTIFIER | OBJC_IGNORE | OBJC2_IGNORE )* ( OBJC_SEMI | '@end' )
FunctionDefinition
         ::= DeclarationSpecifiers? Declarator DeclarationList? CompoundStatement
Declaration
         ::= DeclarationSpecifiers InitDeclaratorList? ';'
           | ( '@protocol' | '@interface' ) ObjcDef
DeclarationList
         ::= Declaration+
DeclarationSpecifiers
         ::= ( ( StorageClassSpecifier | TypeSpecifier | TypeQualifier ) DeclarationSpecifiers? | BuiltInDeclarationSpecifier TypeQualifierList? ) TypeQualifier?
StorageClassSpecifier
         ::= 'auto'
           | 'register'
           | 'static'
           | 'extern' STRING_LITERAL?
           | 'typedef'
BuiltInTypeSpecifier
         ::= 'void'
           | 'char'
           | 'wchar_t'
           | ( 'short' | 'long' | SIGNED | 'unsigned' ) BuiltInDeclarationSpecifier?
           | 'int'
           | 'float'
           | 'double'
           | '__int8'
           | '__int16'
           | '__int32'
           | '__int64'
BuiltInDeclarationSpecifier
         ::= BuiltInTypeSpecifier
TypeSpecifier
         ::= StructOrUnionSpecifier
           | EnumSpecifier
           | TypedefName
TypeQualifier
         ::= CONST
           | VOLATILE
           | CDECL
           | 'near'
           | 'far'
           | STDCALL
           | FASTCALL
           | '__w64'
           | '__ptr64'
           | '__ptr32'
           | INLINE
           | RESTRICT
           | EXTENSION
           | 'static'
           | DeclSpec
AttributeSpec
         ::= ATTRIBUTE '(' SubIdent ')'
           | AsmStatement
AttributeSpecList
         ::= AttributeSpec+
SubIdent ::= '(' SubIdent? ')'
           | ( ( IDENTIFIER | TypeQualifier ) ( '(' SubIdent? ')' )? | Constant ) ( ',' SubIdent )?
DeclSpec ::= ( '__declspec' | '__readableTo' ) '(' DeclSpecifier ')'
           | AttributeSpecList
DeclSpecifier
         ::= '(' DeclSpecifier ')'
           | IDENTIFIER ( '(' DeclConstant ')' )?
DeclConstant
         ::= INTEGER_LITERAL
           | IDENTIFIER ( ':' INTEGER_LITERAL )?
           | STRING_LITERAL ( '#' IDENTIFIER ( '(' ')' )? STRING_LITERAL )*
PragmaSpec
         ::= PRAGMA PragmaSpecifier
PragmaSpecifier
         ::= '(' PragmaSpecifier ')'
           | PIDENTIFIER ( PIDENTIFIER | PINTEGER_LITERAL | PSTRING_LITERAL )* ( '(' ( PragmaConstant ( ',' PragmaConstant )* )? ')' )?
PragmaConstant
         ::= PINTEGER_LITERAL
           | PIDENTIFIER ( ':' ( PINTEGER_LITERAL | PIDENTIFIER )+ )?
           | PSTRING_LITERAL ( '#' PIDENTIFIER ( '(' ')' )? PSTRING_LITERAL )*
StructOrUnionSpecifier
         ::= StructOrUnion ( IDENTIFIER? '{' StructDeclarationList? '}' AttributeSpecList? | IDENTIFIER )
StructOrUnion
         ::= ( 'struct' | 'union' ) DeclSpec*
StructDeclarationList
         ::= StructDeclaration+
InitDeclaratorList
         ::= InitDeclarator ( ',' InitDeclarator )*
InitDeclarator
         ::= Declarator ( '=' Initializer )?
StructDeclaration
         ::= SpecifierQualifierList? StructDeclaratorList? AttributeSpecList? ';'
SpecifierQualifierList
         ::= ( TypeSpecifier | TypeQualifier )* ( BuiltInDeclarationSpecifier TypeQualifierList? | TypeSpecifier | TypeQualifier )
StructDeclaratorList
         ::= StructDeclarator ( ',' StructDeclarator )*
StructDeclarator
         ::= LineDef
           | Declarator ( ':' ConstantExpression )?
           | ':' ConstantExpression
EnumSpecifier
         ::= 'enum' ( IDENTIFIER? '{' EnumeratorList '}' | IDENTIFIER )
EnumeratorList
         ::= ( LineDef | Enumerator ','? )*
Enumerator
         ::= ( IDENTIFIER | INTEGER_LITERAL ) ( '=' ConstantExpression )?
Declarator
         ::= TypeQualifierList? Pointer? DirectDeclarator AttributeSpecList?
DirectDeclarator
         ::= ( IDENTIFIER | '(' Declarator ')' ) ( '[' ConditionalExpression? ']' )* ( '(' ( ParameterTypeList | IdentifierList )? ')' )*
Pointer  ::= ( ( '*' | '&' ) TypeQualifierList? )+
TypeQualifierList
         ::= TypeQualifier+
ParameterTypeList
         ::= ParameterList ( ',' '...' )?
ParameterList
         ::= ParameterDeclaration ( ',' ParameterDeclaration )*
ParameterDeclaration
         ::= DeclarationSpecifiers ( Declarator | AbstractDeclarator )? ( '=' INTEGER_LITERAL )?
IdentifierList
         ::= IDENTIFIER ( ',' IDENTIFIER )*
Initializer
         ::= AssignmentExpression
           | '{' InitializerList ','? '}'
InitializerList
         ::= Initializer ( ',' Initializer )*
TypeName ::= SpecifierQualifierList AbstractDeclarator?
AbstractDeclarator
         ::= DirectAbstractDeclarator
           | Pointer DirectAbstractDeclarator?
DirectAbstractDeclarator
         ::= ( '(' ( TypeQualifier? AbstractDeclarator | ParameterTypeList )? ')' | '[' ConstantExpression? ']' ) ( '[' ConstantExpression? ']' | '(' ParameterTypeList? ')' )*
TypedefName
         ::= IDENTIFIER
Statement
         ::= AsmStatement
           | DeclarationList
           | LabeledStatement
           | ExpressionStatement
           | CompoundStatement
           | SelectionStatement
           | IterationStatement
           | JumpStatement
           | PragmaSpec
LabeledStatement
         ::= ( IDENTIFIER | 'case' ConstantExpression | 'default' ) ':' Statement
ExpressionStatement
         ::= Expression? ';'
CompoundStatement
         ::= '{' StatementList? '}'
StatementList
         ::= Statement+
AsmStatement
         ::= ASM TypeQualifier? AsmLine
AsmLine  ::= ( IDENTIFIER | STRING_LITERAL | INTEGER_LITERAL | ATTRIBUTE | BuiltInTypeSpecifier | '#' | '+' | '-' | ',' | ':' | '[' AsmLine ']' | '(' AsmLine ')' | '{' AsmLine '}' )+
SelectionStatement
         ::= ( 'if' '(' Expression ')' ( Statement 'else' )? | 'switch' '(' Expression ')' ) Statement
IterationStatement
         ::= ( 'while' '(' Expression | 'for' '(' Expression? ';' Expression? ';' Expression? ) ')' Statement
           | 'do' Statement 'while' '(' Expression ')' ';'
JumpStatement
         ::= ( 'goto' IDENTIFIER | 'continue' | 'break' | 'return' Expression? ) ';'
Expression
         ::= AssignmentExpression ( ',' AssignmentExpression )*
AssignmentExpression
         ::= ( UnaryExpression AssignmentOperator )* ConditionalExpression
AssignmentOperator
         ::= '='
           | '*='
           | '/='
           | '%='
           | '+='
           | '-='
           | '<<='
           | '>>='
           | '&='
           | '^='
           | '|='
ConditionalExpression
         ::= LogicalORExpression ( '?' Expression ':' LogicalORExpression )*
ConstantExpression
         ::= ConditionalExpression
LogicalORExpression
         ::= LogicalANDExpression ( '||' LogicalANDExpression )*
LogicalANDExpression
         ::= InclusiveORExpression ( '&&' InclusiveORExpression )*
InclusiveORExpression
         ::= ExclusiveORExpression ( '|' ExclusiveORExpression )*
ExclusiveORExpression
         ::= ANDExpression ( '^' ANDExpression )*
ANDExpression
         ::= EqualityExpression ( '&' EqualityExpression )*
EqualityExpression
         ::= RelationalExpression ( ( '==' | '!=' ) RelationalExpression )*
RelationalExpression
         ::= ShiftExpression ( ( '<' | '>' | '<=' | '>=' ) ShiftExpression )*
ShiftExpression
         ::= AdditiveExpression ( ( '<<' | '>>' ) AdditiveExpression )?
AdditiveExpression
         ::= MultiplicativeExpression ( ( '+' | '-' ) MultiplicativeExpression )*
MultiplicativeExpression
         ::= CastExpression ( ( '*' | '/' | '%' ) ConstantExpression )?
CastExpression
         ::= ( '(' TypeName ')' )* UnaryExpression
UnaryExpression
         ::= ( '++' | '--' | 'sizeof' )* ( PostfixExpression | UnaryOperator CastExpression | 'sizeof' '(' TypeName ')' )
UnaryOperator
         ::= '&'
           | '*'
           | '+'
           | '-'
           | '~'
           | '!'
PostfixExpression
         ::= PrimaryExpression ( '[' Expression ']' | '(' ArgumentExpressionList? ')' | ( '.' | '->' ) IDENTIFIER | '++' | '--' )*
PrimaryExpression
         ::= IDENTIFIER
           | Constant
           | '(' Expression ')'
ArgumentExpressionList
         ::= AssignmentExpression ( ',' AssignmentExpression )*
Constant ::= INTEGER_LITERAL
           | FLOATING_POINT_LITERAL
           | CHARACTER_LITERAL
           | STRING_LITERAL

<?TOKENS?>

INTEGER_LITERAL
         ::= ( DECIMAL_LITERAL | HEX_LITERAL | OCTAL_LITERAL ) ( 'ull' | 'ULL' | 'ul' | 'UL' | 'll' | 'LL' | 'l' | 'L' | 'U' | 'u' )?
DECIMAL_LITERAL
         ::= [1-9] [0-9]*
HEX_LITERAL
         ::= '0' [xX] [0-9a-fA-F]+
OCTAL_LITERAL
         ::= '0' [0-7]*
FLOATING_POINT_LITERAL
         ::= [0-9]+ ( ( '.' [0-9]* EXPONENT? | EXPONENT ) [fFdD]? | EXPONENT? [fFdD] )
           | '.' [0-9]+ EXPONENT? [fFdD]?
EXPONENT ::= [eE] [+#x2D]? [0-9]+
CHARACTER_LITERAL
         ::= 'L'? "'" ( [^'\#xA#xD] | '\' ( [ntbrf\'"] | ( [0-3]? [0-7] )? [0-7] ) )+ "'"
STRING_LITERAL
         ::= 'L'? '"' ( [^"\#xA#xD] | '\' ( [ntbrf\'"] | ( [0-3]? [0-7] )? [0-7] ) )* '"'
VOLATILE ::= '_'* 'volatile' '_'*
SIGNED   ::= '_'* 'signed'
CONST    ::= '_'* 'const'
CDECL    ::= '_'+ 'cdecl'
PRAGMA   ::= ( '_'+ | '#' ) 'pragma'
STDCALL  ::= '_'+ 'stdcall'
FASTCALL ::= '_'+ 'fastcall'
ATTRIBUTE
         ::= '__attribute' '_'*
EXTENSION
         ::= '_'+ 'extension' '_'*
RESTRICT ::= '_'+ 'restrict'
ASM      ::= '_'* 'asm' '_'*
INLINE   ::= '_'* ( 'inline' | 'forceinline' ) '_'*
LINEALT  ::= '#' [ #x9]+
IDENTIFIER
         ::= LETTER ( LETTER | DIGIT )*
LETTER   ::= [$A-Z_a-z]
DIGIT    ::= [0-9]
ASMBLOCKB
         ::= [^{};]+ [#xD#xA]+
ASMBLOCKP
         ::= [^();]+ [#xD#xA]+
ASM_SEMI ::= ';'
PATH_LITERAL
         ::= '"' [^"#xA#xD]* '"'
LINENUMBER_LITERAL
         ::= [1-9] [0-9]*
PIDENTIFIER
         ::= PLETTER ( PLETTER | PDIGIT )*
PLETTER  ::= [$A-Z_a-z]
PDIGIT   ::= [0-9]
PINTEGER_LITERAL
         ::= ( PDECIMAL_LITERAL | PHEX_LITERAL | POCTAL_LITERAL ) ( 'ull' | 'ULL' | 'ul' | 'UL' | 'll' | 'LL' | 'l' | 'L' | 'U' | 'u' )?
PDECIMAL_LITERAL
         ::= [1-9] [0-9]*
PHEX_LITERAL
         ::= '0' [xX] [0-9a-fA-F]+
POCTAL_LITERAL
         ::= '0' [0-7]*
PSTRING_LITERAL
         ::= 'L'? '"' ( [^"\#xA#xD] | '\' ( [ntbrf\'"] | ( [0-3]? [0-7] )? [0-7] ) )* '"'
OBJC_IGNORE
         ::= [^@$A-Z_a-z0-9;]
OBJC_IDENTIFIER
         ::= ( OBJC_LETTER | OBJC_DIGIT )+
OBJC_LETTER
         ::= [$A-Z_a-z]
OBJC_DIGIT
         ::= [0-9]
OBJC_SEMI
         ::= ';'
OBJC2_IGNORE
         ::= [^@]
mingodad commented 3 years ago

And here is the preprocessor Ghidra/Features/Base/src/main/javacc/ghidra/app/util/cparser/CPP/CPP.jj

/*
From https://raw.githubusercontent.com/NationalSecurityAgency/ghidra/master/Ghidra/Features/Base/src/main/javacc/ghidra/app/util/cparser/CPP/CPP.jj
*/

/* converted on Mon Jul 19, 2021, 13:03 (UTC+02) by javacc-to-w3c v0.53 which is Copyright (c) 2011-2021 by Gunther Rademacher <grd@gmx.net> */

Input    ::= TranslationUnit*
TranslationUnit
         ::= Group+
NoMas    ::= EOF
Group    ::= GroupPart
           | IFSection+
GroupPart
         ::= ( Text WS* )+
           | IFSection+
           | ControlLine
ControlLine
         ::= MANIFEST ( ( MacroArgs | WS+ ) MANIFEST )* ( ( MacroArgs+ | MacroVals ) MacroVals* | MacroArgs | MacroArgs+ MacroVals? )?
           | Include
           | UnDef
           | Pragma
           | Error
           | Warning
           | Info
           | LineInfo
           | NoMas
IFSection
         ::= IFGroup
IFGroup  ::= 'if' IfCondition
           | 'elif' ElseIfCondition
           | 'ifdef' IfDefExpr
           | 'ifndef' IfNDefExpr
           | 'else'
           | 'endif'
IfCondition
         ::= CompoundConditionalExpression
ElseIfCondition
         ::= CompoundConditionalExpression
Include  ::= RELATIVE
           | STANDARD
           | MACEXPPATH
           | XSYMLINKPATH
LineInfo ::= LINEINFO
           | NUMERIC
UnDef    ::= CONSTITUENT
MacroArgs
         ::= MACROMV
MacroVals
         ::= Values
           | ( MACRORV | MQUOTED_VALUE )+ Values*
Pragma   ::= PRAGMA_EXPRN
IfDefExpr
         ::= IFDEF_EXPRN
IfNDefExpr
         ::= IFNDEF_EXPRN
Error    ::= ERROR_EXPRN
Warning  ::= WARNING_EXPRN
Info     ::= INFO_EXPRN
Values   ::= VALUES
           | QuotedValue
           | MOREVAL
QuotedValue
         ::= QUOTED_VALUE
Text     ::= ( ( OUTER_TEXT NewLines* | OTHER_TEXT ) NewLines? QuotedText? ( OTHER_TEXT NewLines* )? )+
           | ( ( QuotedText NewLines? | OTHER_TEXT ) NewLines? OTHER_TEXT? NewLines? )+
           | NewLines
NewLines ::= NEWLINE
           | ERRLINE
           | LINLINE
           | PRGLINE
           | INCLINE
QuotedText
         ::= QUOTED_TEXT
CompoundConditionalExpression
         ::= ConditionalExpression
           | CompoundOrExpression
           | CompoundAndExpression
CompoundAndExpression
         ::= ConditionalExpression ( '&&' ConditionalExpression )*
CompoundOrExpression
         ::= ConditionalExpression ( '||' ConditionalExpression )*
ConditionalExpression
         ::= LogicalOrExpression ( '?' LogicalOrExpression ':' LogicalOrExpression )*
LogicalOrExpression
         ::= LogicalAndExpression ( '||' LogicalAndExpression )*
LogicalAndExpression
         ::= EqualityExpression ( '&&' EqualityExpression )*
EqualityExpression
         ::= InEqualityExpression ( '==' InEqualityExpression )*
InEqualityExpression
         ::= RelationalExpression ( '!=' RelationalExpression )*
RelationalExpression
         ::= LessExpression ( '<' LessExpression )*
GreaterThanExpression
         ::= LogNegation ( '>' LogNegation )*
GreaterThanOrEqualExpression
         ::= GreaterThanExpression ( '>=' GreaterThanExpression )*
LessThanOrEqualExpression
         ::= GreaterThanOrEqualExpression ( '<=' GreaterThanOrEqualExpression )*
LessExpression
         ::= LessThanOrEqualExpression ( '<' LessThanOrEqualExpression )*
LogNegation
         ::= '!'* Expression
Negation ::= '-'* Expression
Assertion
         ::= 'defined' Expression
           | ( '__option' | '__has_include' | '__has_include_next' ) '(' Expression ')'
Expression
         ::= ValueExpression ( SubtractFrom ValueExpression )*
SubtractFrom
         ::= '-'
           | '+'
           | '*'
           | '&'
           | '|'
           | '>>'
           | '<<'
ValueExpression
         ::= ( '-' | '+' )? ( NUMERIC | ITEM ( '(' ( ITEM | NUMERIC )+ ')' )? )
           | FP_NUMERIC
           | 'else'
           | 'if'
           | '(' CompoundConditionalExpression ')'
           | Assertion

<?TOKENS?>

_CTRL    ::= WSP* '#' WSP*
_LCMT    ::= '//' [^#xA#xD]* ( #xA | #xD #xA? )
_CMT     ::= '/' '*' [^*]* '*' ( ( [^*/] [^*]* )? '*' )* '/'
_BLANKLINE
         ::= WSP+
_LINECOMMENT
         ::= '//' [^#xA#xD]* ( #xA | #xD #xA? )
_COMMENT ::= '/' '*' [^*]* '*' ( ( [^*/] [^*]* )? '*' )* '/'
COD      ::= '\' WSP* ( #xA | #xD #xA? )
ENDL     ::= #xA
           | #xD #xA?
UNDIR    ::= ( [^"/ #x23#xA#xD#x9] | "'"'" | "'"'" | "'#'" )+
UNDIRALL ::= ( [^"/#xA#xD] | "'"'" | "'"'" | "'#'" )+
NOPAR    ::= [^()]
WSP      ::= [ #x9]
STD      ::= [^>]
REL      ::= [^"]
NOTENDL  ::= [^#xA#xD]
NOTENDLC ::= [^ /#x9#xA#xD]
NOTENDLSTAR
         ::= [^*/#xA#xD]
NOTCMT   ::= [^/*"#xA#xD]
NOTCMTCOD
         ::= [^\/"#xA#xD]
NOTWS    ::= [^ #x9]
NOTWSQ   ::= [^ "#x9#xA#xD]
NOTWQC   ::= [^ /"#x9#xA#xD]
NOTWWSQLT
         ::= [^ <"#x9#xA#xD]
NOTWSQLT ::= [^<"#x9#xA#xD]
INTEGER_LITERAL
         ::= DECIMAL_LITERAL [lL]?
           | HEX_LITERAL [lLU]*
           | OCTAL_LITERAL [lL]*
DECIMAL_LITERAL
         ::= [0-9]+
HEX_LITERAL
         ::= '0' [xX] [0-9a-fA-F]+
HEX_DIGIT
         ::= [0-9a-fA-F]
OCTAL_LITERAL
         ::= '0' [0-7]*
FP_LITERAL
         ::= [0-9]+ ( ( '.' [0-9]* EXPONENT? | EXPONENT ) [fFdD]? | EXPONENT? [fFdD] )
           | '.' [0-9]+ EXPONENT? [fFdD]?
EXPONENT ::= [eE] [+#x2D]? [0-9]+
WS       ::= [ #x9]
OUTER_TEXT
         ::= WSP* UNDIR UNDIRALL*
NEWLINE  ::= ENDL
OTHER_TEXT
         ::= .
QUOTED_TEXT
         ::= '"' ( [^"\#xA#xD] | '\' ( [ntbrf\'"#xA] | ( [0-3]? [0-7] )? [0-7] | #xD #xA? ) )* '"'
DIRLINE  ::= ENDL
_WSP0    ::= WSP
_COD1    ::= COD
_WSP2    ::= WSP
_LCMT0   ::= '/' '/'
EIFLINE  ::= ENDL
_CMT0    ::= '/' '*'
NUMERIC  ::= INTEGER_LITERAL+
FP_NUMERIC
         ::= FP_LITERAL+
ITEM     ::= [a-zA-Z_$] [a-zA-Z_$0-9]*
           | ( '0'? [0-9] | [1-9] ) [0-9]*
_TOEOL   ::= [^/#xA#xD]*
_LCMT11  ::= '/' '/'
_CMT11   ::= '/' '*'
_INCCOD  ::= COD
_INCWSP  ::= WSP
_INCSTANDARD
         ::= '<' [^>)(#xA#xD]* '>'
_HEX     ::= HEX_DIGIT+ ENDL HEX_DIGIT+ ENDL
_XSYMENDL
         ::= ENDL
EXPATH   ::= ENDL
XSYMLINKPATH
         ::= NOTENDL+
INCLINE  ::= ENDL
MACEXPPATH
         ::= NOTWWSQLT NOTWSQLT*
_COD     ::= COD
_WSP     ::= WSP
STANDARD ::= STD+
RELATIVE ::= REL+
PRAGMA_EXPRN
         ::= NOTWS NOTENDL+
PRGLINE  ::= ENDL
_WSP1    ::= WSP
IFDEF_EXPRN
         ::= NOTWS ( '/'? NOTENDLC )+
_LCMT20  ::= '/' '/'
_WSP3    ::= WSP
IFDLINE  ::= ENDL
IFNDEF_EXPRN
         ::= NOTWS ( '/'? NOTENDLC )+
_LCMT21  ::= '/' '/'
_WSP4    ::= WSP
IFNDLINE ::= ENDL
ERROR_EXPRN
         ::= NOTENDL+
ERRLINE  ::= ENDL
_WSP5    ::= WSP
WARNING_EXPRN
         ::= NOTWS NOTENDL+
WARNLINE ::= ENDL
_WSP6    ::= WSP
INFO_EXPRN
         ::= NOTWS NOTENDL+
INFOLINE ::= ENDL
_WSP_INFO
         ::= WSP
UNDLINE  ::= ENDL
_LEADIN1 ::= WSP+
CONSTITUENT
         ::= MANIFEST
_LEADIN2 ::= WSP+
CONLINE  ::= ENDL
_WSP7    ::= WSP
_CODC    ::= COD
MANIFEST ::= [a-zA-Z_$] [a-zA-Z_$0-9]*
           | ( [0-9] | [-+] ( [1-9] | '0' [0-9] ) ) [0-9]*
           | '...'
LINLINE  ::= ENDL
LINEINFO ::= NOTENDL+
_ECMT3   ::= [^*]* '*' ( ( [^*/] [^*]* )? '*' )* '/'
_CMT3    ::= [^#xA#xD]*
_ECMT10  ::= [^*]* '*' ( ( [^*/] [^*]* )? '*' )* '/'
_LCMT4   ::= '/' '/'
_WSP8    ::= WSP
_COD2    ::= WSP* COD
RVSLINE  ::= ENDL
VALUES   ::= ( '/##/' | NOTCMTCOD | '/' NOTENDLSTAR | '\' [^ #xA#xD] )+
MOREVAL  ::= MANIFEST
_ECMT7   ::= ( [^*] | '*' [^/] )*
QUOTED_VALUE
         ::= ( [^"\] | '\' [^#xA#xD] )*
MACROMV  ::= MANIFEST
_ECMT5   ::= '/' '*' [^*]* '*' ( ( [^*/] [^*]* )? '*' )* '/'
_CMT5    ::= '/' '/' [^#xA#xD]+
_COD3    ::= COD
_MACWSP  ::= WSP
MOREARG  ::= NOPAR+
MACRORV  ::= ( NOTCMTCOD | '/' NOTENDLSTAR | '\' [^ \#x9#xA#xD] )+
_LCMT7   ::= '/' '/'
_COD4    ::= WSP* COD
_ECMT8   ::= '/' '*'
MCVLINE  ::= ENDL
LEADIN3  ::= WSP+
MQUOTED_VALUE
         ::= ( [^\"] | '\' [^ #x9#xA#xD] )+
_ECMT9   ::= ( [^*] | '*' [^/] )*
_EECMT9  ::= '*/' WSP* ENDL
_        ::= _CTRL
           | 'XSym'
           | _LCMT
           | _CMT
           | _BLANKLINE
          /* ws: definition */
EOF      ::= $
dev747368 commented 3 years ago

Are you reporting a problem or bug that you have found in the grammar?

mingodad commented 3 years ago

Sorry ! None of then, I'm reporting an alternative view of the grammar for debug, development, documentation and understand purposes.

dev747368 commented 3 years ago

Gotcha. It would probably be best to convert this issue to a discussion.