Created
October 4, 2010 13:42
-
-
Save NilsHaldenwang/609699 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entityDef returns [ entity ] | |
: 'entity' entityName '{' { | |
entity = Entity.new($entityName.text, | |
$entityName.start.line) | |
} | |
(attrib = attribDef { entity << attrib } )+ | |
'}' | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entityDef returns [ entity ] | |
: 'entity' entityName '{' { | |
entity = Entity.new($entityName.text, | |
$entityName.start.line) | |
} | |
attribDef+ | |
'}' | |
; | |
attribDef returns [ attrib ] | |
: ID ':' TYPE { | |
attrib = Attribute.new($ID.text, | |
$TYPE.text.downcase.to_sym, | |
$ID.line) | |
} | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entity User { | |
first_name: String | |
last_name: String | |
age: Integer | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment