[prev in list] [next in list] [prev in thread] [next in thread] 

List:       antlr-dev
Subject:    [antlr-dev] refactored runtime hierarchy etc...
From:       parrt () cs ! usfca ! edu (Terence Parr)
Date:       2005-12-10 13:23:06
Message-ID: 8D63184E-27A5-42A7-BD50-D92AD141D815 () cs ! usfca ! edu
[Download RAW message or body]

* Renamed BaseParser to be BaseRecognizer and even made Lexer derive  
from
   this; nice as it now shares backtracking support code.

* added numRules arg to outputFile, headerFile and the parser,  
treeParser, and lexer templates.  I've added a note to the ST wanted- 
feature list that we should allow the length property on any  
attribute so I could have done <rules.length>.

* refactored synpred stuff so that it's much cleaner.  Here is the  
rule preamble:

         if ( backtracking>0 && alreadyParsedRule(input, 1) )  
{ return; }

and postamble:

             if ( backtracking>0 ) { memoize(input, 1, s_StartIndex); }

These support methods are in BaseRecognizer and have sideeffects  
which i don't like, but it generates much smaller parsers this way.

* Added evalSynPredicate(pred,description) to deal with syn preds  
properly

* Added GrammarFragmentPtr.java in runtime because java is so stupid  
it doesn't have a function ptr.  To factor out a bunch of synpred  
code (avoiding duplication), I had to use this dumb scheme.  THe  
negative is that I must allocate (and empty) object just to pass this  
around. :(   See it's use in BaseRecognizer.

* Added -print option to print out grammar w/o actions

Ter

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic