[svn:parrot] r38866 - branches/pmc_pct/compilers/vtdumper/src/parser

cotto at svn.parrot.org cotto at svn.parrot.org
Sun May 17 04:48:03 UTC 2009


Author: cotto
Date: Sun May 17 04:48:02 2009
New Revision: 38866
URL: https://trac.parrot.org/parrot/changeset/38866

Log:
[vtdumper] grammar is working, now for actions

Modified:
   branches/pmc_pct/compilers/vtdumper/src/parser/grammar.pg

Modified: branches/pmc_pct/compilers/vtdumper/src/parser/grammar.pg
==============================================================================
--- branches/pmc_pct/compilers/vtdumper/src/parser/grammar.pg	Sun May 17 04:15:04 2009	(r38865)
+++ branches/pmc_pct/compilers/vtdumper/src/parser/grammar.pg	Sun May 17 04:48:02 2009	(r38866)
@@ -4,46 +4,44 @@
 grammar VTable::Grammar is PCT::Grammar;
 
 token TOP {
-    <vtable_or_section>
+    <sections>
     [ $ || <panic: 'Syntax error'> ]
     {*}
 }
 
+rule sections {
+    <vtable_or_section>*
+}
+
 rule vtable_or_section {
-    [ <section> | <vtable_func> ]
+    [ <vtable_func> | <section> ]
 }
 
 rule section {
-    '[' <identifier> ']' <attribute>? 
-    {{ say "found a section" }}
+    '[' <identifier> ']' <attribute>?                {*}
 }
 
 rule attribute {
     ':' <identifier>
-    {{ say "found an attribute" }}
 }
 
 
 rule vtable_func {
-    <type> <identifier> '(' <args> ')' <attribute>? 
-    {{ say "found a vtable function" }}
+    <type> <identifier> '(' <args> ')' <attribute>?  {*}
 }
 
 rule type {
-    [ 'struct' | 'union' ]? <identifier> '*'*
-    {{ say "found a type" }}
+    [ 'struct' | 'union' ]? <identifier> '*'?
 }
 
 rule args {
-    [ <arg> [ ',' <args> ]
+    [ <arg> [ ',' <args> ]?
     |
     ]
-    {{ say "found args" }}
 }
 
 rule arg {
     <type> <identifier>
-    {{ say "found an arg" }}
 }
 
 token identifier {


More information about the parrot-commits mailing list