use of org.eclipse.titan.designer.AST.TTCN3.definitions.FormalParameter in project titan.EclipsePlug-ins by eclipse.
the class ParsedActualParameters method findReferences.
@Override
public /**
* {@inheritDoc}
*/
void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) {
if (unnamedPart != null) {
unnamedPart.findReferences(referenceFinder, foundIdentifiers);
}
if (namedPart != null) {
if (formalParList != null) {
for (int i = 0; i < namedPart.getNofParams(); i++) {
final Identifier parName = namedPart.getParamByIndex(i).getName();
final FormalParameter fp = formalParList.getParameterById(parName);
if (fp == referenceFinder.assignment) {
foundIdentifiers.add(new Hit(parName));
}
}
}
namedPart.findReferences(referenceFinder, foundIdentifiers);
}
}
use of org.eclipse.titan.designer.AST.TTCN3.definitions.FormalParameter in project titan.EclipsePlug-ins by eclipse.
the class Function_Type method generateCode.
@Override
public /**
* {@inheritDoc}
*/
void generateCode(final JavaGenData aData, final StringBuilder source) {
final String genName = getGenNameOwn();
final String displayName = getFullName();
generateCodeTypedescriptor(aData, source);
final FunctionReferenceDefinition def = new FunctionReferenceDefinition(genName, displayName);
if (returnType == null) {
def.returnType = null;
} else {
if (returnsTemplate) {
def.returnType = returnType.getGenNameTemplate(aData, source, myScope);
} else {
def.returnType = returnType.getGenNameValue(aData, source, myScope);
}
}
def.type = fatType.FUNCTION;
def.runsOnSelf = runsOnSelf;
def.isStartable = isStartable;
def.formalParList = formalParList.generateCode(aData).toString();
def.actualParList = formalParList.generateCodeActualParlist("").toString();
def.parameterTypeNames = new ArrayList<String>(formalParList.getNofParameters());
def.parameterNames = new ArrayList<String>(formalParList.getNofParameters());
for (int i = 0; i < formalParList.getNofParameters(); i++) {
final FormalParameter formalParameter = formalParList.getParameterByIndex(i);
switch(formalParameter.getAssignmentType()) {
case A_PAR_VAL:
case A_PAR_VAL_IN:
case A_PAR_VAL_INOUT:
case A_PAR_VAL_OUT:
def.parameterTypeNames.add(formalParameter.getType(CompilationTimeStamp.getBaseTimestamp()).getGenNameValue(aData, source, getMyScope()));
break;
case A_PAR_TEMP_IN:
case A_PAR_TEMP_INOUT:
case A_PAR_TEMP_OUT:
def.parameterTypeNames.add(formalParameter.getType(CompilationTimeStamp.getBaseTimestamp()).getGenNameTemplate(aData, source, getMyScope()));
break;
default:
break;
}
def.parameterNames.add(formalParameter.getIdentifier().getName());
}
FunctionReferenceGenerator.generateValueClass(aData, source, def);
FunctionReferenceGenerator.generateTemplateClass(aData, source, def);
if (hasDoneAttribute()) {
generateCodeDone(aData, source);
}
if (subType != null) {
subType.generateCode(aData, source);
}
generateCodeForCodingHandlers(aData, source);
}
Aggregations