no pivate and potected anymoe
This commit is contained in:
parent
d2ed7c9fde
commit
404aa3236f
@ -3,12 +3,12 @@ grammar Decaf;
|
|||||||
program: classdecl+;
|
program: classdecl+;
|
||||||
|
|
||||||
//class identifier{...}
|
//class identifier{...}
|
||||||
classdecl: (AccessModifierPrivate|AccessModifierPublic|AccessModifierProtected)? 'class' Identifier OpenCurlyBracket (constuctorDecl|fieldDecl|methodDecl)* ClosedCurlyBracket;
|
classdecl: AccessModifierPublic? 'class' Identifier OpenCurlyBracket (constuctorDecl|fieldDecl|methodDecl)* ClosedCurlyBracket;
|
||||||
constuctorDecl: (AccessModifierPrivate|AccessModifierPublic|AccessModifierProtected)? Identifier OpenRoundBracket parameterList? ClosedRoundBracket block; //Maybe not needed
|
constuctorDecl: AccessModifierPublic? Identifier OpenRoundBracket parameterList? ClosedRoundBracket block; //Maybe not needed
|
||||||
|
|
||||||
//Method and FieldVar
|
//Method and FieldVar
|
||||||
methodDecl: MainMethodDecl block | (AccessModifierPrivate|AccessModifierPublic|AccessModifierProtected)? (type | Void) Identifier OpenRoundBracket parameterList? ClosedRoundBracket block;
|
methodDecl: MainMethodDecl block | AccessModifierPublic? (type | Void) Identifier OpenRoundBracket parameterList? ClosedRoundBracket block;
|
||||||
fieldDecl: (AccessModifierPrivate|AccessModifierPublic|AccessModifierProtected)? type Identifier Semicolon;
|
fieldDecl: AccessModifierPublic? type Identifier Semicolon;
|
||||||
|
|
||||||
//Parameters
|
//Parameters
|
||||||
parameterList: parameter(Comma parameter)*;
|
parameterList: parameter(Comma parameter)*;
|
||||||
@ -57,8 +57,6 @@ value: IntValue | BooleanValue | CharValue | NullValue;
|
|||||||
|
|
||||||
//Access modifier
|
//Access modifier
|
||||||
AccessModifierPublic : 'public' ;
|
AccessModifierPublic : 'public' ;
|
||||||
AccessModifierPrivate : 'private';
|
|
||||||
AccessModifierProtected : 'protected';
|
|
||||||
MainMethodDecl : 'public static void main(String[] args)';
|
MainMethodDecl : 'public static void main(String[] args)';
|
||||||
|
|
||||||
//Types
|
//Types
|
||||||
|
Loading…
Reference in New Issue
Block a user