Skip to content
domna edited this page Sep 20, 2011 · 5 revisions
scalaFile     ::= [scalaExpr] [prologDef] [scalaExpr];
prologDef     ::= "%prolog" prologFunDef "{" prologBody "}";
prologFunDef  ::= "[" funcs "]";
funcs         ::= func { "," func };
func          ::= id "(" funArgs ")" ":" "(" varTypes ")" "=>" id "(" ids ")";
funArgs       ::= funArg { "," funArg };
varTypes      ::= varType { "," varType };
funArg        ::= id ":" varType;
varType       ::=   "Int"
                  | "Double
                  | "String"
                  | ( "List" | "PrologList" ) "[" varType "]";
id            ::= id { "," id };

Here the four Regex Classes used:

scalaExpr     ::= [^%]*
prologBody    ::= [^}]*
stringLiteral ::= The StringRegex out of the JavaTokenParsers class
id            ::= [a-zA-Z]\w*

Clone this wiki locally