Skip to content

Commit

Permalink
Membership and Ordering can have attributes; Label tokens are now cal…
Browse files Browse the repository at this point in the history
…led Keys and are also used for Properties; Labels and Properties can be classified as define, declare or anntoate using three different separators ':', '::', or '@'
  • Loading branch information
akollegger committed Oct 6, 2024
1 parent 9d52439 commit 4e46523
Show file tree
Hide file tree
Showing 9 changed files with 1,403 additions and 569 deletions.
6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode"]
"recommendations": [
"nrwl.angular-console",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner"
]
}
37 changes: 22 additions & 15 deletions gram.ne
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Subject -> "[" _ Attributes _ Association:? "]"
Association ->
Membership | Ordering

Membership -> "|" _ AssociationMember (_ "," _ AssociationMember):*
Membership -> "|" (Labels:? Record:? _ "|"):? _ AssociationMember (_ "," _ AssociationMember):*

Ordering -> "->" _ AssociationMember (_ "," _ AssociationMember):+
Ordering -> ("->" | "-[" Labels:? Record:? "]->") _ AssociationMember (_ "," _ AssociationMember):+

AssociationMember -> (PatternElement | Reference)

Expand All @@ -27,7 +27,7 @@ Node -> "(" _ Attributes _ ")"

Relationship -> Node Arrow Path

Annotation -> "@" Symbol "(" Value ")"
Annotation -> Annotate Symbol (("(" Value ")") | ":")

Arrow ->
PlainArrow
Expand Down Expand Up @@ -59,23 +59,24 @@ Attributes -> Identity:? Labels:? Record:?

Identity -> Value

Labels -> (DeclaredLabels | DefinedLabels)

DeclaredLabels -> (Declare Label):+

DefinedLabels -> (Define Label):+

Label -> Symbol
Labels -> ( (Define | Declare | Annotate) Key):+

Record ->
"{" _ "}" _
| "{" _ Property ("," _ Property ):* "}" _
"{" _ "}"
| "{" _ Property ("," _ Property ):* "}"

Property -> Key _ ( Define | Declare | Annotate ) _ Value

Property -> Symbol _ (Declare | Define ) _ Value
# What something has
Define -> ":"

# What something might have
Declare -> "::"

Define -> ":"
# What it means
Annotate -> "@"

Key -> ( Symbol | StringLiteral )

Value ->
Null
Expand All @@ -86,12 +87,18 @@ Value ->
| Measurement
| TaggedStringLiteral
| Range
| Record
| ValueList

ValueList ->
"[" _ "]"
| "[" _ Value (_ "," _ Value):* _ "]"

Null -> "null"

Boolean -> "true" | "false"

Symbol -> [a-zA-Z_] [0-9a-zA-Z_@]:* | StringLiteral
Symbol -> [a-zA-Z_] [0-9a-zA-Z_@]:*

Range ->
NumericLiteral ".." NumericLiteral
Expand Down
Loading

0 comments on commit 4e46523

Please sign in to comment.