[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ignored tokens

Hi Fidel!

> Where are the ignored tokens stored again?

They are stored in the member "ignoredTokens" of the "Parser" class. 
Ignored tokens are grouped into linked lists attached to the first token
that follows.

You would retrieve a list of ignored tokens that precedes a nodes, this

  Token somenode = ...;
  LinkedList ignList = Parser.ignoredTokens.getIn(somenode);
  // do something with each ignored token preceding "somenode"
  for(Iterator i = ignList.iterator(); i.hasNext(); )
    Token ignToken = (Token) i.next();

Ignored tokens are grouped into lists, because you might have zero, one,
two, or more ignored tokens between two non-ignored tokens;-)

Have fun!

Etienne M. Gagnon, M.Sc.                     e-mail: egagnon@j-meg.com
Author of SableVM:                             http://www.sablevm.org/