asdlGen
Reference Manual
: Input Syntax
: View Syntax
: Sugared SyntaxThe above example show only the simplest syntax to define view entry there are three sugared versions that remove some of the redundancy of the simple syntax. The first sugared version allows the assignment of the same property value pair to a set of entities. The next sugared version allows assigning to different entities different values for a fixed property. The final sugared version allows the assignment of different property value pairs to the same entity. Examples of the sugared notation are shown below in their respective order.
view Doc {
{ M.Int M.Symbol
M.Cons M.Nil } <= doc_string : s-expression constructor
<= doc_string {
module M
%%
Types for representing LISP s-expressions.
%%
M.sexpr : s-expressions
}
}
view Java {
M.sexpr <= {
source_name : Sexpr
base_class : MyClass
}
}
asdlGen
Reference Manual
: Input Syntax
: View Syntax
: Sugared Syntax