Laurita

Solo disponible en BuenasTareas
  • Páginas : 4 (782 palabras )
  • Descarga(s) : 0
  • Publicado : 23 de agosto de 2012
Leer documento completo
Vista previa del texto
//Regla 1: MainClass | Goal TypeDeclaration ;
Goal ::=
MainClass: MC
{:
raiz = new DeclaracionMain_AST(MC);
:}
|
Goal:G TypeDeclaration: TD{:
raiz = new DelcaracionTipoMain_AST (G, TD)
:}
//--------------------------------------------------------------------------------------------------------------
// Regla2: CLASS ID CORCHETEi PUBLIC STATIC VOID MAIN PARENTi TSTRING PARENTCUAi PARENTCUAd ID PARENTd CORCHETEi PrintStatement CORCHETEd CORCHETEd ;
MainClass ::=
CLASS ID:id1 CORCHETEiPUBLIC STATIC VOID MAIN PARENTi TSTRING PARENTCUAi PARENTCUAd ID:id2 PARENTd CORCHETEi PrintStatement:PS CORCHETEd CORCHETEd
{:
RESULT = new MainClass_AST(id1,id2,PS);
:}//--------------------------------------------------------------------------------------------------------------
// Regla 3: ClassDeclaration | ClassExtendsDeclaration ;TypeDeclaration::=
ClassDeclaration:CD
{:
RESULT = new DeclaracionClase_AST(CD);
:}
|
{:
ClassExtendsDeclaration:CED
RESULT = newDeclaracionClaseExtendida_AST(CED);
:}
//--------------------------------------------------------------------------------------------------------------
//Regla 4: CLASS ID CORCHETEi VarDeclsMethodDecls CORCHETEd ;
ClassDeclaration ::=
CLASS ID:id CORCHETEi VarDecls:VD MethodDecls:MD CORCHETEd
{:
RESULT = new ClassDeclaration_AST (id, VD, MD);
:}//--------------------------------------------------------------------------------------------------------------
//Regla 5: CLASS ID EXTENDS ID CORCHETEi VarDecls MethodDecls CORCHETEd ;ClassExtendsDeclaration ::=
CLASS ID:id1 EXTENDS ID:id2 CORCHETEi VarDecls:VD MethodDecls:MD CORCHETEd
{:
RESULT = new ClassExtendsDeclaration_AST(id1, id2, VD, MD);
:}...
tracking img