help.

View: New views
2 Messages — Rating Filter:   Alert me  

help.

by osama abdelwahed :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi all
I have a little problem(confused) about how to construct a semantic analyzer using sablecc for a simple grammar like:

  program = main body
        ;   
body    = lbra varDecl stList rbra
        ;

varDecl = {varDecl} int id  semi |
{noVarDecl}
        ;
   
stList  =
{ReadSt} read id semi |
{Body} body |
{noSt}
        ;
please if some one know how to implement it , let me know , I am a newer in this group,thanks in advance.
 
osama

_______________________________________________
SableCC-Discussion mailing list
SableCC-Discussion@...
http://lists.sablecc.org/listinfo/sablecc-discussion

Re: help.

by Etienne M. Gagnon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Osama,

It would be difficult to explain the construction a semantic analyzer in few words. You should definitely buy a good book on compilers. There are books that use SableCC as one of their reference tools. Alternatively, if you are a student, simply take a course on compilers.

Good luck!

Etienne

osama abdelwahed wrote :

Hi all
I have a little problem(confused) about how to construct a semantic analyzer using sablecc for a simple grammar like:

  program = main body
        ;   
body    = lbra varDecl stList rbra
        ;

varDecl = {varDecl} int id  semi |
{noVarDecl}
        ;
   
stList  =
{ReadSt} read id semi |
{Body} body |
{noSt}
        ;
please if some one know how to implement it , let me know , I am a newer in this group,thanks in advance.
 
osama

_______________________________________________ SableCC-Discussion mailing list SableCC-Discussion@... http://lists.sablecc.org/listinfo/sablecc-discussion

-- 
Etienne M. Gagnon, Ph.D.
SableCC:                                            http://sablecc.org
SableVM:                                            http://sablevm.org


_______________________________________________
SableCC-Discussion mailing list
SableCC-Discussion@...
http://lists.sablecc.org/listinfo/sablecc-discussion

signature.asc (265 bytes) Download Attachment
LightInTheBox - Buy quality products at wholesale price