Revision: 1900
Author: jsuijs
Date: Fri Apr  9 08:25:31 2010
Log: Williams Anltr grammar update of 2010-04-07
http://code.google.com/p/jallib/source/detail?r=1900

Modified:
 /trunk/grammar/jal.g

=======================================
--- /trunk/grammar/jal.g        Fri Apr  9 08:24:41 2010
+++ /trunk/grammar/jal.g        Fri Apr  9 08:25:31 2010
@@ -21,7 +21,7 @@
 program : ( statement {print $statement.tree.toStringTree();} )+ ;

 statement :
-        block_stmt | for_stmt | forever_stmt if_stmt
+        block_stmt | for_stmt | forever_stmt | if_stmt
         | repeat_stmt | while_stmt | case_stmt
         | var_def | const_def | alias_def
         | proc_def | pseudo_proc_def
@@ -69,7 +69,7 @@
 if_stmt : 'if' expr 'then' statement+
             ('elsif' expr 'then' statement+ )*
             ('else' statement+ )*
-            'end if'
+            'end' 'if'
         ;

 case_stmt : 'case' expr 'of'
@@ -81,20 +81,20 @@

 block_stmt : 'block' statement+ 'end' 'block' ;

-proc_def : 'procedure' IDENTIFIER '(' proc_parm (',' proc_parm)* ')'
+proc_def : 'procedure' IDENTIFIER '(' proc_parm (',' proc_parm)* ')' 'is'
                 statement+
             'end' 'procedure'
     ;

-func_def : 'function' IDENTIFIER '(' proc_parm (',' proc_parm)* ')'
+func_def : 'function' IDENTIFIER '(' proc_parm (',' proc_parm)* ')' 'is'
                 statement+
             'end' 'function'
     ;

-proc_parm : 'volatile'* type ('in' 'out' | 'in' | 'out')
+proc_parm : 'volatile'* type ( IN | 'out' | IN 'out' ) IDENTIFIER
     ;

-pseudo_proc_def : 'procedure' IDENTIFIER '\'' 'put' '(' type 'in' IDENTIFIER ')' 'is' +pseudo_proc_def : 'procedure' IDENTIFIER '\'' 'put' '(' type IN IDENTIFIER ')' 'is'
                 statement+
             'end' 'procedure'
     ;
@@ -104,6 +104,8 @@
             'end' 'function'
     ;

+IN : 'in' ;
+
 alias_def : 'alias' IDENTIFIER 'is' IDENTIFIER
         ;

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to