Update of /cvsroot/bprocessor/bscript/src/etc
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv583/src/etc
Modified Files:
bscript.g
Log Message:
Improvements to scripting
Index: bscript.g
===================================================================
RCS file: /cvsroot/bprocessor/bscript/src/etc/bscript.g,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** bscript.g 29 Sep 2006 07:13:16 -0000 1.9
--- bscript.g 10 Oct 2006 13:49:35 -0000 1.10
***************
*** 32,35 ****
--- 32,36 ----
LtEq: "<=" ;
GtEq: ">=" ;
+ Assign: ":=" ;
protected Letter
***************
*** 100,104 ****
assignment[Function env]
! : name:Identifier Equal simpleton[env]
{ env.append(new Assign(name.getText())); }
;
--- 101,105 ----
assignment[Function env]
! : name:Identifier Equal expression[env]
{ env.append(new Assign(name.getText())); }
;
***************
*** 152,164 ****
;
simpleton[Function env]
! : variable[env]
! | literal[env]
| StartTerm expression[env] EndTerm
! | Lt statement[env] Gt
;
! expression[Function env]
: evaluation[env]
( Equal evaluation[env] { env.append(new Primitive(Primitive.EQ)); }
--- 153,176 ----
;
+ protected value[Function env]
+ : literal[env]
+ | variable[env]
+ | variable[env] LB ( expression[env] ) RB { env.append(new Primitive(Primitive.GET)); }
+ ;
+
simpleton[Function env]
! : value[env]
| StartTerm expression[env] EndTerm
! | Lt procedurecall[env] Gt
! | unarysimpleton[env]
! ;
!
! unarysimpleton[Function env]
! : Plus simpleton[env]
! | Minus simpleton[env] { env.append(new Primitive(Primitive.NEG)); }
;
! protected expression[Function env]
: evaluation[env]
( Equal evaluation[env] { env.append(new Primitive(Primitive.EQ)); }
***************
*** 171,175 ****
! evaluation[Function env]
: term[env]
( Plus term[env] { env.append(new Primitive(Primitive.ADD)); }
--- 183,187 ----
! protected evaluation[Function env]
: term[env]
( Plus term[env] { env.append(new Primitive(Primitive.ADD)); }
***************
*** 186,198 ****
atom[Function env]
! : literal[env]
! | variable[env]
! | variable[env] LB ( expression[env] ) RB { env.append(new Primitive(Primitive.GET)); }
| StartTerm expression[env] EndTerm
! | unary[env]
! | call[env]
;
! unary[Function env]
: Plus atom[env]
| Minus atom[env] { env.append(new Primitive(Primitive.NEG)); }
--- 198,209 ----
atom[Function env]
! : value[env]
| StartTerm expression[env] EndTerm
! | Lt procedurecall[env] Gt
! | unaryatom[env]
! | functioncall[env]
;
! unaryatom[Function env]
: Plus atom[env]
| Minus atom[env] { env.append(new Primitive(Primitive.NEG)); }
***************
*** 207,211 ****
;
! call[Function env]
: name1:Identifier { env.append(new Mark()); }
StartTerm EndTerm
--- 218,222 ----
;
! functioncall[Function env]
: name1:Identifier { env.append(new Mark()); }
StartTerm EndTerm
|