Guys I have a question. I'm using sablecc 3.2. I was wondering something.
I've extended the lexer to print tokens. This is a typical output:
TId, state : 0, text : [font]
TLPar, state : 0, text : [(]
TBlank, state : 0, text : [ ]
TId, state : 0, text : [arial]
TComma, state : 0, text : [,]
TBlank, state : 0, text : [ ]
TId, state : 0, text : [bold]
TComma, state : 0, text : [,]
TBlank, state : 0, text : [ ]
TNumber, state : 0, text : [20]
TRPar, state : 0, text : [)]
TBlank, state : 0, text : [ ]
TLPar, state : 0, text : [(]
TBlank, state : 0, text : [ ]
TLPar, state : 0, text : [(]
TElement, state : 0, text : [v]
TDot, state : 0, text : [.]
TId, state : 0, text : [degree]
TBlank, state : 0, text : [ ]
TCop, state : 0, text : [>=]
TBlank, state : 0, text : [ ]
TNumber, state : 0, text : [3]
TBlank, state : 0, text : [ ]
TRPar, state : 0, text : [)]
TBlank, state : 0, text : [ ]
TLogicAnd, state : 0, text : [AND]
TBlank, state : 0, text : [ ]
TLogicNot, state : 0, text : [NOT]
TBlank, state : 0, text : [ ]
TElement, state : 0, text : [v]
TDot, state : 0, text : [.]
TId, state : 0, text : [label]
TBlank, state : 0, text : [ ]
TCop, state : 0, text : [==]
TBlank, state : 0, text : [ ]
TString, state : 0, text : ["Roma"]
TBlank, state : 0, text : [ ]
TRPar, state : 0, text : [)]
TBlank, state : 0, text : [ ]
TRPar, state : 0, text : [)]
Parser Exception
[1,71] expecting: EOF
As you can see the lexer prints every token and then, since there is
something that shouldn't be there, the parser generate an Exception, the
last line is a e.getMessage(). So far that's ok. But...since the
e.getMessage() is pretty specific I would guess that there's already a
partial AST. Is thare some way I could explore that partial AST with the
DepthFirstAdapter? Basically this is a part of the specific grammar:
par =
{numero} number |
{stringa} string |
{idpar} id ;
What I want to know is if is possible to know already if that TId or TNumber
are already parameters even if the AST is not complete.
--
Distinti Saluti
Emanuele Ianni
Le informazioni e gli allegati contenuti in questa e-mail sono considerati
confidenziali e possono essere riservati. Qualora non foste il destinatario,
siete pregati di distruggere questo messaggio e notificarmi il problema
immediatamente. In ogni caso, non dovrete spedire a terze parti questa
e-mail. Vi ricordo che la diffusione, l'utilizzo e/o la conservazione dei
dati ricevuti per errore costituiscono violazione alle disposizioni del D.L.
n. 196/2003 denominato "Codice in materia di protezione dei dati personali"
The information in this e.mail and in any attachements is confidential and
may be privileged. If you are not the intended recipient, please destroy
this message and notify the sender immediately. You should not retain, copy
or use this e.mail for any purpose, nor disclose all or any part of its
contents to any other person according to the Italian Legislative Decree n.
196/2003.
_______________________________________________
SableCC-Discussion mailing list
[email protected]
http://lists.sablecc.org/listinfo/sablecc-discussion