[antlr-interest] Modifing a grammar to skip the block of a function

Sorin Fagateanu cyron_16 at yahoo.com
Fri Jul 17 07:44:19 PDT 2009


Hi,


I've run into a problem that despite my best attempts over the last couple
of days, i can't solve myself. I have an action script grammar(AS3.g) taken
from the metaas project and a compilation unit (an .as file) I only need to
process the fields and the methods.My problem is that I can not rely very
much on the parsing of elements in a methodDeclaration code block so I
decided to cut the code block. My scope is that i could have a :
function myFunction():int {
  write everything here blah blah !@#%$^....
  {
     write more stuff here
     here goes other recursive code blocks
  }
  etc...
}
and parse it correctly.

I have followed the examples of multiple-line comments but no success. I
tried to make a lexer that accepts every char words but gives my error when
parsing that on the start of the file it recognize a EVERCHARWORD instead of
specific token needed(PACKAGE for my case),which if i think of that is very
normal ,and all sort of ideas,putting recursive rules and recursive lexers
but did not help me.

I wonder what would be the best aproach to do this and I am asking kindly
for your guidance or at least some hints with how and with what to start.

Thank you in advance,
Sorin
-- 
View this message in context: http://n2.nabble.com/Modifing-a-grammar-to-skip-the-block-of-a-function-tp3275782p3275782.html
Sent from the ANTLR mailing list archive at Nabble.com.


More information about the antlr-interest mailing list