use of org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol in project ballerina by ballerina-lang.
the class SymbolEnter method visit.
@Override
public void visit(BLangWorker workerNode) {
BInvokableSymbol workerSymbol = Symbols.createWorkerSymbol(Flags.asMask(workerNode.flagSet), names.fromIdNode(workerNode.name), env.enclPkg.symbol.pkgID, null, env.scope.owner);
workerNode.symbol = workerSymbol;
defineSymbolWithCurrentEnvOwner(workerNode.pos, workerSymbol);
}
use of org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol in project ballerina by ballerina-lang.
the class SymbolEnter method visit.
@Override
public void visit(BLangFunction funcNode) {
boolean validAttachedFunc = validateFuncReceiver(funcNode);
BInvokableSymbol funcSymbol = Symbols.createFunctionSymbol(Flags.asMask(funcNode.flagSet), getFuncSymbolName(funcNode), env.enclPkg.symbol.pkgID, null, env.scope.owner);
SymbolEnv invokableEnv = SymbolEnv.createFunctionEnv(funcNode, funcSymbol.scope, env);
defineInvokableSymbol(funcNode, funcSymbol, invokableEnv);
// Define function receiver if any.
if (funcNode.receiver != null) {
defineAttachedFunctions(funcNode, funcSymbol, invokableEnv, validAttachedFunc);
}
}
use of org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol in project ballerina by ballerina-lang.
the class SemanticAnalyzer method visit.
// Streaming related methods.
public void visit(BLangForever foreverStatement) {
for (StreamingQueryStatementNode streamingQueryStatement : foreverStatement.gettreamingQueryStatements()) {
analyzeStmt((BLangStatement) streamingQueryStatement, env);
}
List<BLangVariable> globalVariableList = this.env.enclPkg.globalVars;
if (globalVariableList != null) {
for (BLangVariable variable : globalVariableList) {
if (((variable).type.tsymbol) != null) {
if ("stream".equals((((variable).type.tsymbol)).name.value)) {
foreverStatement.addGlobalVariable(variable);
}
}
}
}
List<BVarSymbol> functionParameterList = ((BInvokableSymbol) this.env.scope.owner).getParameters();
for (BVarSymbol varSymbol : functionParameterList) {
if ("stream".equals((((varSymbol).type.tsymbol)).name.value)) {
foreverStatement.addFunctionVariable(varSymbol);
}
}
}
use of org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol in project ballerina by ballerina-lang.
the class CodeGenerator method visit.
public void visit(BLangTransformerInvocation iExpr) {
BInvokableSymbol transformerSymbol = (BInvokableSymbol) iExpr.symbol;
int pkgRefCPIndex = addPackageRefCPEntry(currentPkgInfo, transformerSymbol.pkgID);
int transformerNameCPIndex = addUTF8CPEntry(currentPkgInfo, transformerSymbol.name.value);
TransformerRefCPEntry transformerRefCPEntry = new TransformerRefCPEntry(pkgRefCPIndex, transformerNameCPIndex);
int transformerRefCPIndex = currentPkgInfo.addCPEntry(transformerRefCPEntry);
Operand[] operands = getFuncOperands(iExpr, transformerRefCPIndex);
emit(InstructionCodes.TCALL, operands);
}
use of org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol in project ballerina by ballerina-lang.
the class CodeGenerator method visit.
public void visit(BLangActionInvocation aIExpr) {
BInvokableSymbol actionSymbol = (BInvokableSymbol) aIExpr.symbol;
int pkgRefCPIndex = addPackageRefCPEntry(currentPkgInfo, actionSymbol.pkgID);
int actionNameCPIndex = addUTF8CPEntry(currentPkgInfo, actionSymbol.name.value);
ActionRefCPEntry actionRefCPEntry = new ActionRefCPEntry(pkgRefCPIndex, actionNameCPIndex);
int actionRefCPIndex = currentPkgInfo.addCPEntry(actionRefCPEntry);
Operand[] operands = getFuncOperands(aIExpr, actionRefCPIndex);
emit(InstructionCodes.ACALL, operands);
}
Aggregations