Appendix — Grammar Flow Cards

Scope: parser-context flow illustrations for AEON Core v1.

This appendix illustrates the legal flow through AEON Core v1 syntax by parser context. It is not a replacement for the AEON Core v1 Structure and Syntax Reference; when this appendix and the structure syntax reference conflict, the structure syntax reference wins.

The key framing is:

  • the lexer produces tokens without deciding most structural legality;

  • parser contexts decide what may legally follow;

  • recovery may produce partial syntax trees, but a parse with errors is not a successful parse unless a recovery surface explicitly says so.

1. Document Flow

Grammar railroad diagram Grammar productions: Document ::= [HeaderBindings] BodyBinding {Separator BodyBinding} EOF; Separator ::= "," | Newline. Document ::= HeaderBindings BodyBinding Separator BodyBinding EOF Separator ::= , Newline

Grammar productions: Document ::= [HeaderBindings] BodyBinding {Separator BodyBinding} EOF; Separator ::= "," | Newline.

AEON document grammar

Rules:

  • shorthand header bindings and structured header bindings are recognized only in the initial header block;

  • after the first body binding, aeon:mode = "strict" is parsed as an ordinary typed binding unless another rule rejects it;

  • top-level binding keys in one document must be unique after key decoding;

  • duplicate top-level keys fail closed with DUPLICATE_KEY.

2. Binding Head Flow

Canonical binding head order is:

aeon
key\identity\@{attributes}:type = value
Grammar railroad diagram Grammar productions: Binding ::= Key [Identity] [Attributes] [TypeAnnotation] "=" Value. Binding ::= Key Identity Attributes TypeAnnotation = Value

Grammar productions: Binding ::= Key [Identity] [Attributes] [TypeAnnotation] "=" Value.

AEON binding-head grammar

Legal:

aeon
a = 1
a\id\ = 1
a@{meta=1} = 1
a:int = 1
a\id\@{meta=1}:int = 1

Illegal:

aeon
a@{meta=1}\id\:int = 1
a:int@{meta=1} = 1
a@{x=1}@{y=2} = 1

3. Attribute Entry Flow

Attribute entries reuse the binding-head shape, but live inside @{...}:

aeon
a@{entry@{nested=1}:type = value} = payload
Grammar railroad diagram Grammar productions: AttributeEntry ::= Key [Identity] [NestedAttributes] [TypeAnnotation] "=" Value. AttributeEntry ::= Key Identity NestedAttributes TypeAnnotation = Value

Grammar productions: AttributeEntry ::= Key [Identity] [NestedAttributes] [TypeAnnotation] "=" Value.

AEON attribute-entry grammar

Rules:

  • duplicate keys inside one attribute map fail closed with DUPLICATE_KEY;

  • one nested attribute head is legal when max_attribute_depth allows it;

  • repeated heads on one attribute entry are illegal, even when depth is raised;

  • key\id\@{...}:type = value is legal; key:type@{...} = value and key@{...}\id\:type = value are not.

Examples:

aeon
a@{x=1, y=2} = 3
a@{x@{origin="core"} = 2} = 1

Rejected:

aeon
a@{x=1, x=2} = 3
a@{x@{y=1}@{z=2} = 3} = 4
a@{x:int@{y=1} = 2} = 3

4. Type Annotation Flow

Grammar railroad diagram Grammar productions: TypeAnnotation ::= ":" TypeName [GenericArguments] [DatatypeClarifiers]; GenericArguments ::= "<" Type {"," Type} ">"; DatatypeClarifiers ::= "[" Value {"," Value} "]". TypeAnnotation ::= : TypeName GenericArguments DatatypeClarifiers GenericArguments ::= < Type , Type > DatatypeClarifiers ::= [ Value , Value ]

Grammar productions: TypeAnnotation ::= ":" TypeName [GenericArguments] [DatatypeClarifiers]; GenericArguments ::= "<" Type {"," Type} ">"; DatatypeClarifiers ::= "[" Value {"," Value} "]".

AEON type-annotation grammar

Rules:

  • binding and attribute-entry type annotations must be followed by =;

  • anonymous typed values use :type = value only in list, tuple, and node-child contexts;

  • node-head inline datatypes are syntactically narrower than ordinary binding types and accept generic arguments only for :node<T>;

  • generic and separator depth policies are enforced by parser options.

5. Value Dispatch

Grammar railroad diagram Grammar productions: Value ::= Object | List | Tuple | Node | Reference | Literal | TrimtickString. Value ::= Object List Tuple Node Reference Literal TrimtickString

Grammar productions: Value ::= Object | List | Tuple | Node | Reference | Literal | TrimtickString.

AEON value grammar

Value starts include:

AEON value-start dispatch
StartValue family
{object
[list
(tuple
<node
~, ~>clone or pointer reference
string tokenstring
number-like tokennumber, infinity, NaN
! formnull literal
boolean/toggle keywordboolean or toggle
#, %, $, ^ literal tokenhex, radix, encoding, separator literal
trimtick openertrimtick string

An identifier by itself is not a value. Use a reference marker for reference values.

6. Container Flow Matrix

AEON container parsing contexts
ContextEntry formSeparatorsCloseAttribute rule
DocumentBindingcomma or newlineEOFattributes attach to binding head
ObjectBindingcomma or newline}attributes attach to member binding head
ListValue or TypedValuecomma or newline]no floating binding head
TupleValue or TypedValuecomma or newline)no floating binding head
Node childrenValue or TypedValuecomma or newline) then >node head attributes appear before children
Attribute mapAttributeEntrycomma or newline}nested entry head allowed only once and policy-limited

Object attachment examples:

aeon
x@{meta=1} = { k = 2 }
x = { k@{meta=1} = 2 }

Rejected floating form:

aeon
x = { @{meta=1} k = 2 }

7. Node Head Flow

Grammar railroad diagram Grammar productions: Node ::= "<" Tag [Attributes] [NodeType] (">" | "(" [Value {Separator Value}] ")" ">"). Node ::= < Tag Attributes NodeType > ( Value Separator Value ) >

Grammar productions: Node ::= "<" Tag [Attributes] [NodeType] (">" | "(" [Value {Separator Value}] ")" ">").

AEON node grammar

Rules:

  • node heads may have one attribute block;

  • repeated node head attribute blocks are illegal;

  • child-bearing nodes require the final > after the child list closes.

8. Reference Path Flow

Grammar railroad diagram Grammar productions: Reference ::= ("~" | "~>") (Root | Member | BracketMember) {ReferenceSegment}; ReferenceSegment ::= "." Member | "[" IndexOrMember "]" | "@" Attribute. Reference ::= ~ ~> Root Member BracketMember ReferenceSegment ReferenceSegment ::= . Member [ IndexOrMember ] @ Attribute

Grammar productions: Reference ::= ("~" | "~>") (Root | Member | BracketMember) {ReferenceSegment}; ReferenceSegment ::= "." Member | "[" IndexOrMember "]" | "@" Attribute.

AEON reference-path grammar

Rules:

  • $ is the explicit root;

  • dot traversal and bracket traversal address data namespace segments;

  • .@.key and .@.["key"] address attribute namespace segments;

  • empty quoted member segments and empty quoted attribute segments are invalid.

9. Comments And Trivia Flow

Comments are not values, bindings, or separators by themselves.

Comment and trivia grammar effects
SurfaceLexer/parser roleGrammar effect
spaces/tabslayout trivianever separate two same-line bindings by themselves
newlinestructural token when enabledseparator only in contexts that consume newline
line commentcomment/triviaends at newline; surrounding grammar still decides separation
block commentcomment/triviamay span newlines; does not become a value
structured comment channelannotation side channelattachment rules do not redefine syntax

Examples:

aeon
a = 1 // comment
b = 2

The newline after the line comment separates the bindings; the comment itself does not.

aeon
a = 1 /* comment */ b = 2

Plain spaces plus a block comment do not create a document binding separator.

10. Ambiguity Checklist

Table 1: AEON grammar ambiguities and expected diagnostics
AmbiguityLegal formIllegal formExpected diagnostic
duplicate top-level keydistinct top-level keysa=1\na=2DUPLICATE_KEY
duplicate object member keydistinct member keysx={a=1,a=2}DUPLICATE_KEY
duplicate attribute keydistinct attribute keysa@{x=1,x=2}=3DUPLICATE_KEY
object vs member attributex@{m=1}={k=2} or x={k@{m=1}=2}x={@{m=1} k=2}SYNTAX_ERROR
nested vs repeated attribute heada@{x@{y=1}=2}=3a@{x@{y=1}@{z=2}=3}=4SYNTAX_ERROR
binding attribute ordera@{x=1}:int=2a:int@{x=1}=2SYNTAX_ERROR
node attribute order<tag@{x=1}:node><tag:node@{x=1}>SYNTAX_ERROR
typed anonymous contexta=[:int=1]a=:int=1SYNTAX_ERROR
space-only separationa=1\nb=2 or a=1,b=2a=1 b=2SYNTAX_ERROR

These examples should remain mirrored by implementation tests or CTS cases when the behavior is normative.

Document Metadata

Standing: official · Lifecycle: published · Normativity: informative

Created: · Modified:

License: CC-BY-4.0

Available formats: HTML, Markdown, &ND, AEON source