Subversion Repositories programming

Rev

Rev 229 | Rev 232 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 229 Rev 231
Line 38... Line 38...
38
%token ASSIGNOP
38
%token ASSIGNOP
39
 
39
 
40
/* J-Minus Grammar */
40
/* J-Minus Grammar */
41
%%
41
%%
42
program : modifier CLASS ID LBRACE method_declaration RBRACE
42
program : modifier CLASS ID LBRACE method_declaration RBRACE
43
        { System.out.println ("program -> modifier class id { method_declaration }"); };
43
        { System.out.println ("program -> modifier class id { method_declaration }");
-
 
44
          System.out.println ("\nPARSING SUCCESSFUL: ACCEPT"); };
44
 
45
 
45
modifier : PUBLIC   { System.out.println ("modifier -> public"); }
46
modifier : PUBLIC   { System.out.println ("modifier -> public"); }
46
    | PRIVATE       { System.out.println ("modifier -> private"); };
47
    | PRIVATE       { System.out.println ("modifier -> private"); };
47
 
48
 
48
method_declaration : modifier type_specifier ID LPAREN param RPAREN
49
method_declaration : modifier type_specifier ID LPAREN param RPAREN