Grammar
Visual grammar reference for STYX. See Parser for normative rules.
Document:
Document ::= Entry*Entry:
Entry ::= DocComment? Atom+referenced by:
- CommaSeparated
- Document
- NewlineSeparated
DocComment:
DocComment
::= ( '///' NonNewline* Newline )+referenced by:
- Entry
Atom:
Atom ::= Scalar
| Sequence
| Object
| '@'
| Tag
| Attributesreferenced by:
- Entry
- Sequence
Scalar:
Scalar ::= BareScalar
| QuotedScalar
| RawScalar
| HeredocScalarreferenced by:
- Atom
BareScalar:
BareScalar
::= BareChar+referenced by:
- Attribute
- AttributeValue
- Scalar
BareChar:
BareChar ::= [^{}(),"=@#x20#x09#x0A#x0D]referenced by:
- BareScalar
QuotedScalar:
QuotedScalar
::= '"' QuotedChar* '"'referenced by:
- AttributeValue
- Scalar
- TagPayload
QuotedChar:
QuotedChar
::= EscapeSeq
| [^"\]referenced by:
- QuotedScalar
EscapeSeq:
EscapeSeq
::= '\' ( [\"nrt0] | 'u' HexDigit HexDigit HexDigit HexDigit | 'u{' HexDigit HexDigit? HexDigit? HexDigit? HexDigit? HexDigit? '}' )referenced by:
- QuotedChar
HexDigit:
HexDigit ::= [0-9A-Fa-f]referenced by:
- EscapeSeq
RawScalar:
RawScalar
::= 'r' '#'* '"' RawChar* '"' '#'*referenced by:
- Scalar
- TagPayload
RawChar:
RawChar ::= [^"]+referenced by:
- RawScalar
HeredocScalar:
HeredocScalar
::= '<<' Delimiter Newline HeredocLine* Delimiterreferenced by:
- Scalar
- TagPayload
Delimiter:
Delimiter
::= [A-Z] [A-Z0-9_]*referenced by:
- HeredocScalar
HeredocLine:
HeredocLine
::= NonNewline* Newlinereferenced by:
- HeredocScalar
Tag:
Tag ::= '@' TagName TagPayload?referenced by:
- Atom
TagName:
TagName ::= [A-Za-z_] [A-Za-z0-9_.#x2D]*referenced by:
- Tag
TagPayload:
TagPayload
::= Object
| Sequence
| QuotedScalar
| RawScalar
| HeredocScalar
| '@'referenced by:
- Tag
Sequence:
Sequence ::= '(' WS* ( Atom ( WS+ Atom )* )? WS* ')'referenced by:
- Atom
- AttributeValue
- TagPayload
Object:
Object ::= '{' ObjectBody '}'referenced by:
- Atom
- AttributeValue
- TagPayload
ObjectBody:
ObjectBody
::= NewlineSeparated
| CommaSeparated
| WS*referenced by:
- Object
NewlineSeparated:
NewlineSeparated
::= WS* Entry ( Newline+ Entry )* WS*referenced by:
- ObjectBody
CommaSeparated:
CommaSeparated
::= WS* Entry ( ',' Entry )* WS*referenced by:
- ObjectBody
Attributes:
Attributes
::= Attribute+referenced by:
- Atom
Attribute:
Attribute
::= BareScalar '=' AttributeValuereferenced by:
- Attributes
AttributeValue:
AttributeValue
::= BareScalar
| QuotedScalar
| Sequence
| Objectreferenced by:
- Attribute
LineComment:
LineComment
::= '//' NonNewline*referenced by:
- WS
WS:
WS ::= [#x20#x09#x0A#x0D]
| LineCommentreferenced by:
- CommaSeparated
- NewlineSeparated
- ObjectBody
- Sequence
Newline:
Newline ::= #x0D? #x0Areferenced by:
- DocComment
- HeredocLine
- HeredocScalar
- NewlineSeparated
NonNewline:
NonNewline
::= [^#x0A#x0D]referenced by:
- DocComment
- HeredocLine
- LineComment
generated by RR - Railroad Diagram Generator