I have tried valuesof(role) - it results in this output in ipad:
Roles{
System.Dataflow.TermValuesWrapper
}
Here's the full grammar:
module CslaCommon
{
export Common;
language Common
{
// Parameterized List rule
syntax List(element, separator)
= n:element
=> { n }
| l:List(element, separator) separator n:element
=> { valuesof(l), n };
// Whitespace
token Tab = "\u0009";
token LF = "\u000A";
token CR = "\u000D";
token Space = "\u0020";
token Comma = ",";
token Whitespace = Tab | LF | CR | Space | Comma;
}
}
module Csla
{
import CslaCommon { Common as C };
language MCsla
{
final token True =
"true"
=> true;
final token False =
"false"
=> false;
//token Text = Language.Grammar.TextLiteral;
token Text = oq:'"' body:Language.Base.Letter+ cq:'"'
=> body;
syntax RoleText = body:Text
=> { Value = body };
token Param = p:(Language.Base.Digit+ | Text | True | False)
=> { Value = p };
token Token = Language.Base.Letter+ (Language.Base.Letter | Language.Base.Digit)*;
@{Classification["Keyword"]}
token Stereotype = "Object";
@{Classification["Keyword"]}
token In = "in";
@{Classification["Keyword"]}
token Scope = ("Public" | "Private");
@{Classification["Keyword"]}
token ReadOnly = "ReadOnly";
@{Classification["Keyword"]}
token Identity = "Identity";
@{Classification["Keyword"]}
token AuthAction = "Allow";
@{Classification["Keyword"]}
token AuthType = ("Create" | "Get" | "Edit" | "Delete");
@{Classification["Keyword"]}
token PropertyAuthAction = ("Allow" | "Deny");
@{Classification["Keyword"]}
token PropertyAuthType = ("Read" | "Write");
@{Classification["Keyword"]}
token Rule = "Rule";
final token EndStatement = ';';
final token BeginBlock = "{";
final token EndBlock = "}";
final token OpenParen = "(";
final token CloseParen = ")";
@{Classification["Comment"]}
token Comment = Language.Grammar.Comment;
syntax Boolean(e) =
e
=> true | empty => false;
syntax PropertyAuthRule =
ad:PropertyAuthAction autht:PropertyAuthType OpenParen role:C.List(RoleText, ",") CloseParen EndStatement
=> PropertyAuthRule { Action = ad, AuthType = autht, Roles = { valuesof(role) } };
syntax BusinessRuleNP =
Rule method:Token EndStatement
=> PropertyBizRule { Method = method, Blag = method };
syntax BusinessRuleWP =
Rule method:Token OpenParen params:C.List(Param, ",") CloseParen EndStatement
=> PropertyBizRule { Method = method, Params = { valuesof(params) } };
syntax BusinessRule =
np:BusinessRuleNP
=> np
| wp:BusinessRuleWP
=> wp;
syntax SimpleProperty =
scope:Scope ro:Boolean(ReadOnly) type:Token name:Token EndStatement
=> Property { Name = name, Scope =scope, ReadOnly = ro, Type = type };
syntax PropertyMembers =
p:PropertyAuthRule
=> p
| b:BusinessRule
=> b;
syntax ComplexProperty =
scope:Scope ro:Boolean(ReadOnly) type:Token name:Token BeginBlock items:PropertyMembers* EndBlock
=> Property { Name = name, Scope = scope, ReadOnly = ro, Type = type, PropertyMembers = { valuesof(items) } };
syntax Property =
s:SimpleProperty
=> s
| c:ComplexProperty
=> c;
syntax AuthRule =
AuthAction autht:AuthType OpenParen role:C.List(RoleText, ",") CloseParen EndStatement
=> ClassAuthRule { AuthType = autht, Roles = role };
syntax ClassMembers =
a:AuthRule
=> a
| p:Property
=> p;
syntax Object =
st:Stereotype class:Token In namespace:Token BeginBlock items:ClassMembers* EndBlock Identity ident:Token EndStatement
=> Class { Name = class, Namespace=namespace, Stereotype = st, Identity = ident, ClassMembers = { valuesof(items) } };
syntax Main = o:Object* => Classes { valuesof(o) };
interleave Ignore = C.Whitespace | Language.Grammar.Comment;
}
}