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

No Subject



Hi, folks!
I'm trying to get used to SableCC and I have three queries about it.
The first is regarding the states:
looking the following example :

States
normal,comment;
Tokens
{normal->comment, comment} ... ;

what does it mean the expression between { and }.
Does it mean that the lexer will transite to state comment and stay in state
comment when reconginsing the regular expression that follows it ?

and for example in {comment, comment->normal}, does it mean that it is in
state comment and transites to state normal when recognising the regular
expression that follows it ?

The second query is regarding productions, eg:
in the following production :

prod = P.Package | ...;
what effect does the P. has on the alternative ?

and for example in
Token =
T.Tokens |...;
what effect does the T. has ?

Finally, the last one is regarding the ? operator.
in the production

program =
program_heading? ...;

I know that it has no effect on AST, but my question is how do we manipulate
it ?
What does SableCC generates to allows us to manipulate it ?
Do we have to write any extension of the Node class ?
Please, let me know!
Regards,
Fidel Viegas.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com