[Bprocessor-commit] bscript/src/etc bscript.g,1.10,1.11
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-10-10 14:41:39
|
Update of /cvsroot/bprocessor/bscript/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21574/src/etc Modified Files: bscript.g Log Message: Syntax for creating strings and literal arrays Index: bscript.g =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/etc/bscript.g,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** bscript.g 10 Oct 2006 13:49:35 -0000 1.10 --- bscript.g 10 Oct 2006 14:41:36 -0000 1.11 *************** *** 29,32 **** --- 29,34 ---- LB : '[' ; RB : ']' ; + LC : '{' ; + RC : '}' ; Equal: '=' ; LtEq: "<=" ; *************** *** 56,59 **** --- 58,64 ---- ; + String + : ( '"' ( ~'"' )* '"' ) + ; *************** *** 159,162 **** --- 164,173 ---- ; + protected list[Function env] + : LC { env.append(new Mark()); } + expression[env] ( Comma expression[env] ) * + RC { env.append(new Primitive(Primitive.LST)); } + ; + simpleton[Function env] : value[env] *************** *** 164,167 **** --- 175,179 ---- | Lt procedurecall[env] Gt | unarysimpleton[env] + | list[env] ; *************** *** 203,206 **** --- 215,219 ---- | unaryatom[env] | functioncall[env] + | list[env] ; *************** *** 210,215 **** --- 223,231 ---- ; + + literal[Function env] : n:Number { env.append(new Literal(new Double(n.getText()))); } + | s:String { env.append(new Literal(s.getText().substring(1, s.getText().length() - 1))); } ; |