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



Question 1
I will have to produce an extension of  a DepthFirstAdapter generated by

SableCC itself.

For instance for the rule:
suite02_bmr70 = thdr one_entity suite02_bmr70
              | {empty}

I have to produce the java code
 public void caseASuite01Bmr70(ASuite01Bmr70 node)
   {  System.out.println("caseASuite01Bmr70") ;
      bmrcou = new BMR70K() ;
   // Get one_entity
      (node.getOneEntity()).apply(this) ;
   // Add vector
      bmrcou.AddToVector_liste_entity(symcou) ;
   // Next Apply
      (node.getSuite02Bmr70()).apply(this) ;
So do you know a SableCC method: Convert
Convert(suite02_bmr70) gives Suite01Bmr70
Convert(one_entity) gives OneEntity.

Question 2
Normally, I use the Lexer and the Parser (generated by SableCC) I have a
finished input : a File.

In my case, my input is a TCP/IP Stream, where a End of Stream says
"This is the end, or this is an error".

The parser is able to say : " I have read a full coherent sequence,
therefore I want to stop and do the AST walk to produce actions. Then I
want to continu reading from the TCP/IP Stream."

My question is : How can I say to the parser, stop when you have see a
coherent block (I can write in the grammar, that I have a coherent