Search in sources :

Example 11 with BLangStruct

use of org.wso2.ballerinalang.compiler.tree.BLangStruct in project ballerina by ballerina-lang.

the class SymbolEnter method defineStructFields.

private void defineStructFields(List<BLangStruct> structNodes, SymbolEnv pkgEnv) {
    structNodes.forEach(struct -> {
        // Create struct type
        SymbolEnv structEnv = SymbolEnv.createPkgLevelSymbolEnv(struct, struct.symbol.scope, pkgEnv);
        BStructType structType = (BStructType) struct.symbol.type;
        structType.fields = struct.fields.stream().peek(field -> defineNode(field, structEnv)).map(field -> new BStructField(names.fromIdNode(field.name), field.symbol)).collect(Collectors.toList());
    });
    // define init function
    structNodes.forEach(struct -> {
        SymbolEnv structEnv = SymbolEnv.createPkgLevelSymbolEnv(struct, struct.symbol.scope, pkgEnv);
        defineStructInitFunction(struct, structEnv);
    });
}
Also used : BStructType(org.wso2.ballerinalang.compiler.semantics.model.types.BStructType) BInvokableType(org.wso2.ballerinalang.compiler.semantics.model.types.BInvokableType) BLangReturn(org.wso2.ballerinalang.compiler.tree.statements.BLangReturn) BAttachedFunction(org.wso2.ballerinalang.compiler.semantics.model.symbols.BStructSymbol.BAttachedFunction) BLangIdentifier(org.wso2.ballerinalang.compiler.tree.BLangIdentifier) BConnectorType(org.wso2.ballerinalang.compiler.semantics.model.types.BConnectorType) BTypeSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BTypeSymbol) BVarSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BVarSymbol) BLangImportPackage(org.wso2.ballerinalang.compiler.tree.BLangImportPackage) Flag(org.ballerinalang.model.elements.Flag) IdentifierNode(org.ballerinalang.model.tree.IdentifierNode) TopLevelNode(org.ballerinalang.model.tree.TopLevelNode) BLangCompilationUnit(org.wso2.ballerinalang.compiler.tree.BLangCompilationUnit) BAnnotationSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BAnnotationSymbol) Names(org.wso2.ballerinalang.compiler.util.Names) BServiceSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BServiceSymbol) BEnumType(org.wso2.ballerinalang.compiler.semantics.model.types.BEnumType) EnumSet(java.util.EnumSet) BLangAssignment(org.wso2.ballerinalang.compiler.tree.statements.BLangAssignment) BLangDiagnosticLog(org.wso2.ballerinalang.compiler.util.diagnotic.BLangDiagnosticLog) BLangSimpleVarRef(org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef) BXMLNSSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BXMLNSSymbol) BConnectorSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BConnectorSymbol) BStructType(org.wso2.ballerinalang.compiler.semantics.model.types.BStructType) BLangExpression(org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression) CompilerPhase(org.ballerinalang.compiler.CompilerPhase) BXMLAttributeSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BXMLAttributeSymbol) BSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol) PackageID(org.ballerinalang.model.elements.PackageID) Set(java.util.Set) BPackageSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol) BLangXMLNS(org.wso2.ballerinalang.compiler.tree.BLangXMLNS) BLangAnnotAttribute(org.wso2.ballerinalang.compiler.tree.BLangAnnotAttribute) Collectors(java.util.stream.Collectors) BLangTransformer(org.wso2.ballerinalang.compiler.tree.BLangTransformer) BLangNode(org.wso2.ballerinalang.compiler.tree.BLangNode) BLangService(org.wso2.ballerinalang.compiler.tree.BLangService) List(java.util.List) IMPORT(org.ballerinalang.model.tree.NodeKind.IMPORT) Scope(org.wso2.ballerinalang.compiler.semantics.model.Scope) BLangEnum(org.wso2.ballerinalang.compiler.tree.BLangEnum) NodeKind(org.ballerinalang.model.tree.NodeKind) BAnnotationAttributeSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BAnnotationAttributeSymbol) StatementNode(org.ballerinalang.model.tree.statements.StatementNode) BStructSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BStructSymbol) BLangWorker(org.wso2.ballerinalang.compiler.tree.BLangWorker) BLangEndpoint(org.wso2.ballerinalang.compiler.tree.BLangEndpoint) BLangXMLNSStatement(org.wso2.ballerinalang.compiler.tree.statements.BLangXMLNSStatement) BLangInvokableNode(org.wso2.ballerinalang.compiler.tree.BLangInvokableNode) BLangAction(org.wso2.ballerinalang.compiler.tree.BLangAction) BStructField(org.wso2.ballerinalang.compiler.semantics.model.types.BStructType.BStructField) BLangUserDefinedType(org.wso2.ballerinalang.compiler.tree.types.BLangUserDefinedType) BAnnotationType(org.wso2.ballerinalang.compiler.semantics.model.types.BAnnotationType) BLangVariable(org.wso2.ballerinalang.compiler.tree.BLangVariable) BLangExpressionStmt(org.wso2.ballerinalang.compiler.tree.statements.BLangExpressionStmt) BLangAnnotation(org.wso2.ballerinalang.compiler.tree.BLangAnnotation) BLangXMLAttribute(org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLAttribute) BLangStatement(org.wso2.ballerinalang.compiler.tree.statements.BLangStatement) BLangNodeVisitor(org.wso2.ballerinalang.compiler.tree.BLangNodeVisitor) PackageLoader(org.wso2.ballerinalang.compiler.PackageLoader) TypeTags(org.wso2.ballerinalang.compiler.util.TypeTags) BServiceType(org.wso2.ballerinalang.compiler.semantics.model.types.BServiceType) Flags(org.wso2.ballerinalang.util.Flags) BLangResource(org.wso2.ballerinalang.compiler.tree.BLangResource) DocTag(org.ballerinalang.model.elements.DocTag) TreeBuilder(org.ballerinalang.model.TreeBuilder) BType(org.wso2.ballerinalang.compiler.semantics.model.types.BType) BInvokableSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol) DiagnosticPos(org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos) XMLConstants(javax.xml.XMLConstants) BLangPackage(org.wso2.ballerinalang.compiler.tree.BLangPackage) SymbolEnv(org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv) BTransformerSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BTransformerSymbol) BLangObject(org.wso2.ballerinalang.compiler.tree.BLangObject) BLangXMLQName(org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLQName) Symbols(org.wso2.ballerinalang.compiler.semantics.model.symbols.Symbols) BLangFunction(org.wso2.ballerinalang.compiler.tree.BLangFunction) Name(org.wso2.ballerinalang.compiler.util.Name) SymTag(org.wso2.ballerinalang.compiler.semantics.model.symbols.SymTag) DiagnosticCode(org.ballerinalang.util.diagnostic.DiagnosticCode) BLangLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangLiteral) BLangEnumerator(org.wso2.ballerinalang.compiler.tree.BLangEnum.BLangEnumerator) BLangInvocation(org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation) BLangConnector(org.wso2.ballerinalang.compiler.tree.BLangConnector) BEndpointVarSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BEndpointVarSymbol) BLangStruct(org.wso2.ballerinalang.compiler.tree.BLangStruct) BLangBlockStmt(org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt) SymbolTable(org.wso2.ballerinalang.compiler.semantics.model.SymbolTable) CompilerContext(org.wso2.ballerinalang.compiler.util.CompilerContext) BStructField(org.wso2.ballerinalang.compiler.semantics.model.types.BStructType.BStructField) SymbolEnv(org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv)

Example 12 with BLangStruct

use of org.wso2.ballerinalang.compiler.tree.BLangStruct in project ballerina by ballerina-lang.

the class TaintAnalyzer method visit.

public void visit(BLangStruct structNode) {
    BSymbol structSymbol = structNode.symbol;
    SymbolEnv structEnv = SymbolEnv.createPkgLevelSymbolEnv(structNode, structSymbol.scope, env);
    structNode.fields.forEach(field -> analyzeNode(field, structEnv));
}
Also used : BSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol) SymbolEnv(org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv)

Example 13 with BLangStruct

use of org.wso2.ballerinalang.compiler.tree.BLangStruct in project ballerina by ballerina-lang.

the class CodeGenerator method createStructInfoEntry.

private void createStructInfoEntry(BLangStruct structNode) {
    BStructSymbol structSymbol = (BStructSymbol) structNode.symbol;
    // Add Struct name as an UTFCPEntry to the constant pool
    int structNameCPIndex = addUTF8CPEntry(currentPkgInfo, structSymbol.name.value);
    StructInfo structInfo = new StructInfo(currentPackageRefCPIndex, structNameCPIndex, structSymbol.flags);
    currentPkgInfo.addStructInfo(structSymbol.name.value, structInfo);
    structInfo.structType = (BStructType) structSymbol.type;
    List<BLangVariable> structFields = structNode.fields;
    for (BLangVariable structField : structFields) {
        // Create StructFieldInfo Entry
        int fieldNameCPIndex = addUTF8CPEntry(currentPkgInfo, structField.name.value);
        int sigCPIndex = addUTF8CPEntry(currentPkgInfo, structField.type.getDesc());
        StructFieldInfo structFieldInfo = new StructFieldInfo(fieldNameCPIndex, sigCPIndex, structField.symbol.flags);
        structFieldInfo.fieldType = structField.type;
        // Populate default values
        if (structField.expr != null && structField.expr.getKind() == NodeKind.LITERAL) {
            DefaultValueAttributeInfo defaultVal = getDefaultValueAttributeInfo((BLangLiteral) structField.expr);
            structFieldInfo.addAttributeInfo(AttributeInfo.Kind.DEFAULT_VALUE_ATTRIBUTE, defaultVal);
        }
        structInfo.fieldInfoEntries.add(structFieldInfo);
        structField.symbol.varIndex = getFieldIndex(structField.symbol.type.tag);
    }
    // Create variable count attribute info
    prepareIndexes(fieldIndexes);
    int[] fieldCount = new int[] { fieldIndexes.tInt, fieldIndexes.tFloat, fieldIndexes.tString, fieldIndexes.tBoolean, fieldIndexes.tBlob, fieldIndexes.tRef };
    addVariableCountAttributeInfo(currentPkgInfo, structInfo, fieldCount);
    fieldIndexes = new VariableIndex(FIELD);
    // Create attached function info entries
    for (BAttachedFunction attachedFunc : structSymbol.attachedFuncs) {
        int funcNameCPIndex = addUTF8CPEntry(currentPkgInfo, attachedFunc.funcName.value);
        // Remove the first type. The first type is always the type to which the function is attached to
        BType[] paramTypes = attachedFunc.type.paramTypes.toArray(new BType[0]);
        if (paramTypes.length == 1) {
            paramTypes = new BType[0];
        } else {
            paramTypes = attachedFunc.type.paramTypes.toArray(new BType[0]);
            paramTypes = Arrays.copyOfRange(paramTypes, 1, paramTypes.length);
        }
        int sigCPIndex = addUTF8CPEntry(currentPkgInfo, generateFunctionSig(paramTypes, attachedFunc.type.retTypes.toArray(new BType[0])));
        int flags = attachedFunc.symbol.flags;
        structInfo.attachedFuncInfoEntries.add(new AttachedFunctionInfo(funcNameCPIndex, sigCPIndex, flags));
    }
}
Also used : BAttachedFunction(org.wso2.ballerinalang.compiler.semantics.model.symbols.BStructSymbol.BAttachedFunction) AttachedFunctionInfo(org.wso2.ballerinalang.programfile.AttachedFunctionInfo) StructInfo(org.wso2.ballerinalang.programfile.StructInfo) StructFieldInfo(org.wso2.ballerinalang.programfile.StructFieldInfo) BStructSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BStructSymbol) BLangEndpoint(org.wso2.ballerinalang.compiler.tree.BLangEndpoint) BLangVariable(org.wso2.ballerinalang.compiler.tree.BLangVariable) ParamDefaultValueAttributeInfo(org.wso2.ballerinalang.programfile.attributes.ParamDefaultValueAttributeInfo) DefaultValueAttributeInfo(org.wso2.ballerinalang.programfile.attributes.DefaultValueAttributeInfo) BType(org.wso2.ballerinalang.compiler.semantics.model.types.BType)

Example 14 with BLangStruct

use of org.wso2.ballerinalang.compiler.tree.BLangStruct in project ballerina by ballerina-lang.

the class AnnotationDesugar method rewritePackageAnnotations.

protected void rewritePackageAnnotations(BLangPackage pkgNode) {
    BLangFunction initFunction = pkgNode.initFunction;
    // Remove last return statement. we will add it later. TODO : Fix this properly.
    initFunction.body.stmts.remove(initFunction.body.stmts.size() - 1);
    // This is the variable which store all package level annotations.
    BLangVariable annotationMap = createGlobalAnnotationMapVar(pkgNode);
    // handle Service Annotations.
    for (BLangService service : pkgNode.services) {
        generateAnnotations(service, service.name.value, initFunction, annotationMap);
        for (BLangResource resource : service.resources) {
            String key = service.name.value + DOT + resource.name.value;
            generateAnnotations(resource, key, initFunction, annotationMap);
        }
    }
    // Handle Function Annotations.
    for (BLangFunction function : pkgNode.functions) {
        generateAnnotations(function, function.symbol.name.value, initFunction, annotationMap);
    }
    // Handle Connector Annotations.
    for (BLangConnector connector : pkgNode.connectors) {
        generateAnnotations(connector, connector.name.value, initFunction, annotationMap);
        for (BLangAction action : connector.actions) {
            String key = connector.name.value + DOT + action.name.value;
            generateAnnotations(connector, key, initFunction, annotationMap);
        }
    }
    // Handle Struct Annotations.
    for (BLangStruct struct : pkgNode.structs) {
        generateAnnotations(struct, struct.name.value, initFunction, annotationMap);
        for (BLangVariable field : struct.fields) {
            String key = struct.name.value + DOT + field.name.value;
            generateAnnotations(field, key, initFunction, annotationMap);
        }
    }
    for (BLangEndpoint globalEndpoint : pkgNode.globalEndpoints) {
        generateAnnotations(globalEndpoint, globalEndpoint.name.value, initFunction, annotationMap);
    }
    ASTBuilderUtil.createReturnStmt(pkgNode.pos, initFunction.body);
}
Also used : BLangEndpoint(org.wso2.ballerinalang.compiler.tree.BLangEndpoint) BLangFunction(org.wso2.ballerinalang.compiler.tree.BLangFunction) BLangService(org.wso2.ballerinalang.compiler.tree.BLangService) BLangResource(org.wso2.ballerinalang.compiler.tree.BLangResource) BLangStruct(org.wso2.ballerinalang.compiler.tree.BLangStruct) BLangConnector(org.wso2.ballerinalang.compiler.tree.BLangConnector) BLangVariable(org.wso2.ballerinalang.compiler.tree.BLangVariable) BLangAction(org.wso2.ballerinalang.compiler.tree.BLangAction)

Example 15 with BLangStruct

use of org.wso2.ballerinalang.compiler.tree.BLangStruct in project ballerina by ballerina-lang.

the class Desugar method visit.

@Override
public void visit(BLangStruct structNode) {
    // Add struct level variables to the init function.
    structNode.fields.stream().map(field -> {
        // then get the default value literal for that particular struct.
        if (field.expr == null) {
            field.expr = getInitExpr(field.type);
        }
        return field;
    }).filter(field -> field.expr != null).forEachOrdered(field -> {
        if (!structNode.initFunction.initFunctionStmts.containsKey(field.symbol)) {
            structNode.initFunction.initFunctionStmts.put(field.symbol, (BLangStatement) createAssignmentStmt(field));
        }
    });
    // Adding init statements to the init function.
    BLangStatement[] initStmts = structNode.initFunction.initFunctionStmts.values().toArray(new BLangStatement[0]);
    for (int i = 0; i < structNode.initFunction.initFunctionStmts.size(); i++) {
        structNode.initFunction.body.stmts.add(i, initStmts[i]);
    }
    result = structNode;
}
Also used : Arrays(java.util.Arrays) BLangMapLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangRecordLiteral.BLangMapLiteral) BLangStreamLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangRecordLiteral.BLangStreamLiteral) BLangReturn(org.wso2.ballerinalang.compiler.tree.statements.BLangReturn) BLangTableLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangRecordLiteral.BLangTableLiteral) BLangIdentifier(org.wso2.ballerinalang.compiler.tree.BLangIdentifier) BLangBreak(org.wso2.ballerinalang.compiler.tree.statements.BLangBreak) BLangXMLTextLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLTextLiteral) BLangTryCatchFinally(org.wso2.ballerinalang.compiler.tree.statements.BLangTryCatchFinally) BLangTupleDestructure(org.wso2.ballerinalang.compiler.tree.statements.BLangTupleDestructure) Map(java.util.Map) SymbolResolver(org.wso2.ballerinalang.compiler.semantics.analyzer.SymbolResolver) BLangVariableReference(org.wso2.ballerinalang.compiler.tree.expressions.BLangVariableReference) BLangWhile(org.wso2.ballerinalang.compiler.tree.statements.BLangWhile) BLangBinaryExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr) BLangEnumeratorAccessExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangFieldBasedAccess.BLangEnumeratorAccessExpr) CompilerPhase(org.ballerinalang.compiler.CompilerPhase) BLangCompoundAssignment(org.wso2.ballerinalang.compiler.tree.statements.BLangCompoundAssignment) JoinStreamingInput(org.ballerinalang.model.tree.clauses.JoinStreamingInput) Set(java.util.Set) BLangXMLNS(org.wso2.ballerinalang.compiler.tree.BLangXMLNS) BLangMatchStmtPatternClause(org.wso2.ballerinalang.compiler.tree.statements.BLangMatch.BLangMatchStmtPatternClause) StatementNode(org.ballerinalang.model.tree.statements.StatementNode) BStructSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BStructSymbol) BLangLambdaFunction(org.wso2.ballerinalang.compiler.tree.expressions.BLangLambdaFunction) BLangXMLNSStatement(org.wso2.ballerinalang.compiler.tree.statements.BLangXMLNSStatement) BLangArrayAccessExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangIndexBasedAccess.BLangArrayAccessExpr) BLangStructLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangRecordLiteral.BLangStructLiteral) BLangIf(org.wso2.ballerinalang.compiler.tree.statements.BLangIf) BLangInvokableNode(org.wso2.ballerinalang.compiler.tree.BLangInvokableNode) NamedArgNode(org.ballerinalang.model.tree.expressions.NamedArgNode) BLangForeach(org.wso2.ballerinalang.compiler.tree.statements.BLangForeach) StreamingQueryStatementNode(org.ballerinalang.model.tree.statements.StreamingQueryStatementNode) BLangXMLAttribute(org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLAttribute) BLangNamedArgsExpression(org.wso2.ballerinalang.compiler.tree.expressions.BLangNamedArgsExpression) BLangAbort(org.wso2.ballerinalang.compiler.tree.statements.BLangAbort) BLangTypeInit(org.wso2.ballerinalang.compiler.tree.expressions.BLangTypeInit) BLangLocalXMLNS(org.wso2.ballerinalang.compiler.tree.BLangXMLNS.BLangLocalXMLNS) BLangRecordLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangRecordLiteral) Types(org.wso2.ballerinalang.compiler.semantics.analyzer.Types) BLangIndexBasedAccess(org.wso2.ballerinalang.compiler.tree.expressions.BLangIndexBasedAccess) BLangXMLCommentLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLCommentLiteral) BLangPackageVarRef(org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef.BLangPackageVarRef) BLangPostIncrement(org.wso2.ballerinalang.compiler.tree.statements.BLangPostIncrement) ArrayList(java.util.ArrayList) BLangFunctionVarRef(org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef.BLangFunctionVarRef) BLangResource(org.wso2.ballerinalang.compiler.tree.BLangResource) BLangXMLQuotedString(org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLQuotedString) TreeBuilder(org.ballerinalang.model.TreeBuilder) BType(org.wso2.ballerinalang.compiler.semantics.model.types.BType) BLangArrayLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangArrayLiteral) BLangUnaryExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangUnaryExpr) DiagnosticPos(org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos) BArrayType(org.wso2.ballerinalang.compiler.semantics.model.types.BArrayType) BLangPackageXMLNS(org.wso2.ballerinalang.compiler.tree.BLangXMLNS.BLangPackageXMLNS) BLangForkJoin(org.wso2.ballerinalang.compiler.tree.statements.BLangForkJoin) SymbolEnv(org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv) BLangStructFieldAccessExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangFieldBasedAccess.BLangStructFieldAccessExpr) BLangXMLProcInsLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLProcInsLiteral) BLangObject(org.wso2.ballerinalang.compiler.tree.BLangObject) BLangForever(org.wso2.ballerinalang.compiler.tree.statements.BLangForever) GEN_VAR_PREFIX(org.wso2.ballerinalang.compiler.util.Names.GEN_VAR_PREFIX) BLangXMLQName(org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLQName) BLangThrow(org.wso2.ballerinalang.compiler.tree.statements.BLangThrow) BLangJSONAccessExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangIndexBasedAccess.BLangJSONAccessExpr) SymTag(org.wso2.ballerinalang.compiler.semantics.model.symbols.SymTag) BLangLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangLiteral) BEndpointVarSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BEndpointVarSymbol) BLangXMLAccessExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangIndexBasedAccess.BLangXMLAccessExpr) BLangBracedOrTupleExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangBracedOrTupleExpr) CompilerContext(org.wso2.ballerinalang.compiler.util.CompilerContext) BLangAttachedFunctionInvocation(org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation.BLangAttachedFunctionInvocation) BInvokableType(org.wso2.ballerinalang.compiler.semantics.model.types.BInvokableType) BLangTypeConversionExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangTypeConversionExpr) BLangStatementLink(org.wso2.ballerinalang.compiler.tree.statements.BLangStatement.BLangStatementLink) BLangXMLAttributeAccess(org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLAttributeAccess) BLangWorkerReceive(org.wso2.ballerinalang.compiler.tree.statements.BLangWorkerReceive) Lists(org.wso2.ballerinalang.util.Lists) BVarSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BVarSymbol) BLangImportPackage(org.wso2.ballerinalang.compiler.tree.BLangImportPackage) OperatorKind(org.ballerinalang.model.tree.OperatorKind) PackageCache(org.wso2.ballerinalang.compiler.PackageCache) BOperatorSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BOperatorSymbol) Names(org.wso2.ballerinalang.compiler.util.Names) BLangFail(org.wso2.ballerinalang.compiler.tree.statements.BLangFail) BLangJSONLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangRecordLiteral.BLangJSONLiteral) BLangAssignment(org.wso2.ballerinalang.compiler.tree.statements.BLangAssignment) BLangSimpleVarRef(org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef) BXMLNSSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BXMLNSSymbol) BStructType(org.wso2.ballerinalang.compiler.semantics.model.types.BStructType) BLangLock(org.wso2.ballerinalang.compiler.tree.statements.BLangLock) BLangExpression(org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression) BConversionOperatorSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BConversionOperatorSymbol) BSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol) BPackageSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol) BLangTransformerInvocation(org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation.BLangTransformerInvocation) BLangIsAssignableExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangIsAssignableExpr) BLangTypeCastExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangTypeCastExpr) Collectors(java.util.stream.Collectors) BLangTransformer(org.wso2.ballerinalang.compiler.tree.BLangTransformer) BLangNode(org.wso2.ballerinalang.compiler.tree.BLangNode) BLangService(org.wso2.ballerinalang.compiler.tree.BLangService) BLangCatch(org.wso2.ballerinalang.compiler.tree.statements.BLangCatch) BLangFieldBasedAccess(org.wso2.ballerinalang.compiler.tree.expressions.BLangFieldBasedAccess) List(java.util.List) NodeKind(org.ballerinalang.model.tree.NodeKind) InstructionCodes(org.wso2.ballerinalang.programfile.InstructionCodes) BLangActionInvocation(org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation.BLangActionInvocation) BLangWorker(org.wso2.ballerinalang.compiler.tree.BLangWorker) BLangXMLSequenceLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLSequenceLiteral) BLangBind(org.wso2.ballerinalang.compiler.tree.statements.BLangBind) BLangEndpoint(org.wso2.ballerinalang.compiler.tree.BLangEndpoint) BLangAction(org.wso2.ballerinalang.compiler.tree.BLangAction) BLangTableQueryExpression(org.wso2.ballerinalang.compiler.tree.expressions.BLangTableQueryExpression) BLangVariable(org.wso2.ballerinalang.compiler.tree.BLangVariable) BLangExpressionStmt(org.wso2.ballerinalang.compiler.tree.statements.BLangExpressionStmt) BFunctionPointerInvocation(org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation.BFunctionPointerInvocation) BLangStatement(org.wso2.ballerinalang.compiler.tree.statements.BLangStatement) HashMap(java.util.HashMap) BLangNodeVisitor(org.wso2.ballerinalang.compiler.tree.BLangNodeVisitor) BLangTypeofExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangTypeofExpr) BLangTransaction(org.wso2.ballerinalang.compiler.tree.statements.BLangTransaction) Stack(java.util.Stack) TypeTags(org.wso2.ballerinalang.compiler.util.TypeTags) HashSet(java.util.HashSet) BLangVariableDef(org.wso2.ballerinalang.compiler.tree.statements.BLangVariableDef) BLangMatch(org.wso2.ballerinalang.compiler.tree.statements.BLangMatch) BLangLocalVarRef(org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef.BLangLocalVarRef) BLangStringTemplateLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangStringTemplateLiteral) BLangJSONArrayLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangArrayLiteral.BLangJSONArrayLiteral) BInvokableSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol) BLangTernaryExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangTernaryExpr) BLangIntRangeExpression(org.wso2.ballerinalang.compiler.tree.expressions.BLangIntRangeExpression) BLangPackage(org.wso2.ballerinalang.compiler.tree.BLangPackage) BUnionType(org.wso2.ballerinalang.compiler.semantics.model.types.BUnionType) BLangMapAccessExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangIndexBasedAccess.BLangMapAccessExpr) Iterator(java.util.Iterator) BLangFieldVarRef(org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef.BLangFieldVarRef) BLangNext(org.wso2.ballerinalang.compiler.tree.statements.BLangNext) Symbols(org.wso2.ballerinalang.compiler.semantics.model.symbols.Symbols) BLangFunction(org.wso2.ballerinalang.compiler.tree.BLangFunction) Name(org.wso2.ballerinalang.compiler.util.Name) BLangAwaitExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangAwaitExpr) BLangRestArgsExpression(org.wso2.ballerinalang.compiler.tree.expressions.BLangRestArgsExpression) BLangXMLElementLiteral(org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLElementLiteral) BLangWorkerSend(org.wso2.ballerinalang.compiler.tree.statements.BLangWorkerSend) BLangInvocation(org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation) BLangConnector(org.wso2.ballerinalang.compiler.tree.BLangConnector) BTableType(org.wso2.ballerinalang.compiler.semantics.model.types.BTableType) BLangStruct(org.wso2.ballerinalang.compiler.tree.BLangStruct) BLangBlockStmt(org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt) Collections(java.util.Collections) SymbolTable(org.wso2.ballerinalang.compiler.semantics.model.SymbolTable) BLangStatement(org.wso2.ballerinalang.compiler.tree.statements.BLangStatement) BLangEndpoint(org.wso2.ballerinalang.compiler.tree.BLangEndpoint)

Aggregations

BLangStruct (org.wso2.ballerinalang.compiler.tree.BLangStruct)20 BLangFunction (org.wso2.ballerinalang.compiler.tree.BLangFunction)11 BLangVariable (org.wso2.ballerinalang.compiler.tree.BLangVariable)10 ArrayList (java.util.ArrayList)7 Test (org.testng.annotations.Test)7 BLangConnector (org.wso2.ballerinalang.compiler.tree.BLangConnector)7 BLangPackage (org.wso2.ballerinalang.compiler.tree.BLangPackage)7 DiagnosticPos (org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos)7 List (java.util.List)6 CompileResult (org.ballerinalang.launcher.util.CompileResult)6 IdentifierNode (org.ballerinalang.model.tree.IdentifierNode)6 PackageNode (org.ballerinalang.model.tree.PackageNode)6 BSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol)6 BLangDocumentation (org.wso2.ballerinalang.compiler.tree.BLangDocumentation)6 BLangEndpoint (org.wso2.ballerinalang.compiler.tree.BLangEndpoint)6 BLangService (org.wso2.ballerinalang.compiler.tree.BLangService)6 Map (java.util.Map)5 Collectors (java.util.stream.Collectors)5 SymbolEnv (org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv)5 BType (org.wso2.ballerinalang.compiler.semantics.model.types.BType)5