Skip to main content

module examples::dataModel::Syntax

rascal-0.40.16
typepal-0.14.8

Usage

import examples::dataModel::Syntax;

Source code

http://github.com/usethesource/typepal/src/examples/dataModel/Syntax.rsc

Dependencies

extend examples::CommonLex;

syntax Program

start syntax Program = Declaration+ decls;

syntax Declaration

syntax Declaration
= "entity" Id name "{" Field+ fields "}"
;

syntax Type

syntax Type = "int" | "str" | Id typ | "Set" "\<" Type elmType  "\>";

syntax Keywords

keyword Keywords 
= "int"
| "str"
| "Set"
| "entity"
| "field"
| "inverse"
;

syntax Field

syntax Field 
= biReference: Id name "-\>" Type typ "inverse" Id ref "::" Id attr
;