use of org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv in project ballerina by ballerina-lang.
the class CodeGenerator method visit.
public void visit(BLangResource resourceNode) {
ResourceInfo resourceInfo = currentServiceInfo.resourceInfoMap.get(resourceNode.name.getValue());
currentCallableUnitInfo = resourceInfo;
SymbolEnv resourceEnv = SymbolEnv.createResourceActionSymbolEnv(resourceNode, resourceNode.symbol.scope, this.env);
visitInvokableNode(resourceNode, currentCallableUnitInfo, resourceEnv);
}
use of org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv in project ballerina by ballerina-lang.
the class Desugar method visit.
@Override
public void visit(BLangResource resourceNode) {
addReturnIfNotPresent(resourceNode);
SymbolEnv resourceEnv = SymbolEnv.createResourceActionSymbolEnv(resourceNode, resourceNode.symbol.scope, env);
// To preserve endpoint code gen order at resource
Collections.reverse(resourceNode.endpoints);
resourceNode.endpoints = rewrite(resourceNode.endpoints, resourceEnv);
resourceNode.body = rewrite(resourceNode.body, resourceEnv);
resourceNode.workers = rewrite(resourceNode.workers, resourceEnv);
result = resourceNode;
}
use of org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv in project ballerina by ballerina-lang.
the class Desugar method visit.
@Override
public void visit(BLangService serviceNode) {
SymbolEnv serviceEnv = SymbolEnv.createServiceEnv(serviceNode, serviceNode.symbol.scope, env);
serviceNode.resources = rewrite(serviceNode.resources, serviceEnv);
serviceNode.vars = rewrite(serviceNode.vars, serviceEnv);
serviceNode.endpoints = rewrite(serviceNode.endpoints, serviceEnv);
serviceNode.initFunction = rewrite(serviceNode.initFunction, serviceEnv);
result = serviceNode;
}
use of org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv in project ballerina by ballerina-lang.
the class Desugar method visit.
@Override
public void visit(BLangFunction funcNode) {
SymbolEnv fucEnv = SymbolEnv.createFunctionEnv(funcNode, funcNode.symbol.scope, env);
if (!funcNode.interfaceFunction) {
addReturnIfNotPresent(funcNode);
}
// To preserve endpoint code gen order.
Collections.reverse(funcNode.endpoints);
funcNode.endpoints = rewrite(funcNode.endpoints, fucEnv);
funcNode.body = rewrite(funcNode.body, fucEnv);
funcNode.workers = rewrite(funcNode.workers, fucEnv);
// the struct variable as the first parameter
if (funcNode.receiver != null) {
BInvokableSymbol funcSymbol = funcNode.symbol;
List<BVarSymbol> params = funcSymbol.params;
params.add(0, funcNode.receiver.symbol);
BInvokableType funcType = (BInvokableType) funcSymbol.type;
funcType.paramTypes.add(0, funcNode.receiver.type);
}
result = funcNode;
}
use of org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv in project ballerina by ballerina-lang.
the class Desugar method visit.
@Override
public void visit(BLangConnector connectorNode) {
SymbolEnv conEnv = SymbolEnv.createConnectorEnv(connectorNode, connectorNode.symbol.scope, env);
connectorNode.params = rewrite(connectorNode.params, conEnv);
connectorNode.actions = rewrite(connectorNode.actions, conEnv);
connectorNode.varDefs = rewrite(connectorNode.varDefs, conEnv);
connectorNode.endpoints = rewrite(connectorNode.endpoints, conEnv);
connectorNode.initFunction = rewrite(connectorNode.initFunction, conEnv);
connectorNode.initAction = rewrite(connectorNode.initAction, conEnv);
result = connectorNode;
}
Aggregations