Commit b7b0c694 authored by Miklos Magyari's avatar Miklos Magyari
Browse files

parser fix for functions; moved code for property formal param list creation


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent ae2d6fd7
......@@ -114,6 +114,12 @@ public final class Property_Type extends Type {
this.hasSetter = false;
this.hasGetter = false;
this.hasBody = false;
// constructing a fake formal parameter list for supporting the 'value' keyword
FormalParameter valueParam = new FormalParameter(null, Assignment_type.A_PAR_VAL_IN, myType, new Identifier(Identifier_type.ID_TTCN, "value"), null, null);
List<FormalParameter> paramList = new ArrayList<FormalParameter>();
paramList.add(valueParam);
fpList = new FormalParameterList(paramList);
}
/**
......@@ -176,11 +182,6 @@ public final class Property_Type extends Type {
getLocation().reportSemanticError(EMPTYBODY);
}
FormalParameter valueParam = new FormalParameter(null, Assignment_type.A_PAR_VAL_IN, myType, new Identifier(Identifier_type.ID_TTCN, "value"), null, null);
List<FormalParameter> paramList = new ArrayList<FormalParameter>();
paramList.add(valueParam);
fpList = new FormalParameterList(paramList);
checkModifiers();
if (getterStatementBlock != null) {
......
......@@ -9403,7 +9403,7 @@ pr_ClassConstructorDef returns[Def_Function def_func]
if(parameters == null) { parameters = new FormalParameterList(new ArrayList<FormalParameter>()); }
parameters.setLocation(getLocation( $pstart.start, $pstop.stop));
Identifier id = new Identifier( Identifier_type.ID_TTCN, "create", getLocation($id.start, $id.stop ) );
$def_func = new Def_Function(id, parameters, null, null, null, null, null, false, null, null, statementBlock, null, true, false, false, null);
$def_func = new Def_Function(id, parameters, null, null, null, null, null, false, null, null, statementBlock, null, false, false, null);
$def_func.setLocation(getLocation( $id.start, $sb.stop));
$def_func.setCommentLocation( getLastCommentLocation( $start ) );
};
......
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