[antlr-interest] Runtime code question - v3 ea4

Gary Evans evansgr_99 at hotmail.com
Mon Jul 11 11:18:38 PDT 2005


Folks,

I have been studying the code in the runtime in order to translate it to 
another language,  and I have a question about a couple of the classes:  
ANTLRFileStream and  ANTLRStringStream.  Just a quick note - I am not a real 
programmer, and I am just now  learning about java, so I may have completely 
missed the boat here (so please be kind if  this is the case).

Within these classes is a method called "public int mark()".  It looks like 
a useless  method since all it does is create a CharStreamState object, give 
it the data from .p,  .line, and .charPositionInLine, and then it just 
returns 0!

Shouldn't it do something more, like save that state back into the variable 
markers?

If not, then what method does save data into markers?  All I can see is that 
when the  object is initialized, it saves a blank CharStreamState into 
markers.  After that, I don't  see anything that puts more information into 
markers, so what is its purpose?

Also, rewind() gives us the ability to go to a particular mark within 
markers and set the  local variables to those values - but I cannot figure 
out where we ever set any information  in markers.

FYI - I am looking at the code for antlr v3 ea4 (I think).  I clicked on a 
link to download  version ea5, but the name of the file that was actually 
downloaded was ea4.

Thanks,
gevans




More information about the antlr-interest mailing list