Commit 5a514e34 authored by Miklos Magyari's avatar Miklos Magyari
Browse files

OOP: better parsing for properties


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent d0cb4f74
......@@ -4543,12 +4543,15 @@ pr_SingleVarInstance[Type type, parameterEvaluationType eval] returns[Def_Var de
$definition = null;
Value value = null;
ArrayDimensions dimensions = null;
boolean isProperty = false;
}:
( i = pr_Identifier
( ( PROPERTYKEYWORD { isProperty = true; } )?
i = pr_Identifier
( d = pr_ArrayDef { dimensions = $d.dimensions; })?
( pr_AssignmentChar
v = pr_VarInitialValue { value = $v.value; }
)?
pr_PropertyBody?
)
{
if ($i.identifier != null) {
......@@ -9155,7 +9158,6 @@ pr_ClassMember returns[List<Definition> definitions]
$definitions.add( $cl.def_type );
}
}
| pr_PropertyDef
)
)
{
......@@ -9396,34 +9398,42 @@ pr_SelectClassCase:
SEMICOLON?
);
pr_PropertyDef:
pr_PropertyBody:
(
PROPERTYKEYWORD
t = pr_Type
i = pr_Identifier
(
pr_BeginChar
( pr_PropertyGetter pr_PropertySetter?
| pr_PropertySetter pr_PropertyGetter?
)
pr_EndChar
);
pr_PropertyGetter:
(
( PUBLIC | PRIVATE )?
( pr_AbstractModifier | pr_FinalModifier )?
DETERMINISTICKEYWORD?
GETKEYWORD
(
(
( vis1 = pr_OopVisibility )?
( ABSTRACTKEYWORD
| FINALKEYWORD
| DETERMINISTICKEYWORD
CLASSCASTING
pr_TemplateBody
| pr_StatementBlock
)
)?
GETKEYWORD
( CLASSCASTING pr_TemplateBody
| sb1 = pr_StatementBlock )?
SEMICOLON?
|
( vis2 = pr_OopVisibility )?
( ABSTRACTKEYWORD
| FINALKEYWORD
| DETERMINISTICKEYWORD
)?
);
pr_PropertySetter:
(
( PUBLIC | PRIVATE )?
( pr_AbstractModifier | pr_FinalModifier )?
DETERMINISTICKEYWORD?
SETKEYWORD
( CLASSCASTING pr_TemplateBody
| sb2 = pr_StatementBlock )?
SEMICOLON?
)*
pr_EndChar
(
( CLASSCASTING
pr_TemplateBody
| pr_StatementBlock
)
)?
SEMICOLON?
);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment