Search in sources :

Example 1 with BLangTupleTypeNode

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

the class SymbolResolver method visit.

public void visit(BLangTupleTypeNode tupleTypeNode) {
    List<BType> memberTypes = tupleTypeNode.memberTypeNodes.stream().map(memTypeNode -> resolveTypeNode(memTypeNode, env)).collect(Collectors.toList());
    resultType = new BTupleType(memberTypes);
}
Also used : BInvokableType(org.wso2.ballerinalang.compiler.semantics.model.types.BInvokableType) BTupleType(org.wso2.ballerinalang.compiler.semantics.model.types.BTupleType) BMapType(org.wso2.ballerinalang.compiler.semantics.model.types.BMapType) BLangTupleTypeNode(org.wso2.ballerinalang.compiler.tree.types.BLangTupleTypeNode) Lists(org.wso2.ballerinalang.util.Lists) BLangBuiltInRefTypeNode(org.wso2.ballerinalang.compiler.tree.types.BLangBuiltInRefTypeNode) BTypeSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BTypeSymbol) BLangValueType(org.wso2.ballerinalang.compiler.tree.types.BLangValueType) OperatorKind(org.ballerinalang.model.tree.OperatorKind) Flag(org.ballerinalang.model.elements.Flag) Map(java.util.Map) SymbolKind(org.ballerinalang.model.symbols.SymbolKind) BOperatorSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BOperatorSymbol) Names(org.wso2.ballerinalang.compiler.util.Names) EnumSet(java.util.EnumSet) BLangDiagnosticLog(org.wso2.ballerinalang.compiler.util.diagnotic.BLangDiagnosticLog) BXMLNSSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BXMLNSSymbol) BLangArrayType(org.wso2.ballerinalang.compiler.tree.types.BLangArrayType) BLangUnionTypeNode(org.wso2.ballerinalang.compiler.tree.types.BLangUnionTypeNode) TypeKind(org.ballerinalang.model.types.TypeKind) BConversionOperatorSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BConversionOperatorSymbol) BSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol) Set(java.util.Set) Collectors(java.util.stream.Collectors) List(java.util.List) NOT_FOUND_ENTRY(org.wso2.ballerinalang.compiler.semantics.model.Scope.NOT_FOUND_ENTRY) Scope(org.wso2.ballerinalang.compiler.semantics.model.Scope) Stream(java.util.stream.Stream) InstructionCodes(org.wso2.ballerinalang.programfile.InstructionCodes) BLangUserDefinedType(org.wso2.ballerinalang.compiler.tree.types.BLangUserDefinedType) BStreamType(org.wso2.ballerinalang.compiler.semantics.model.types.BStreamType) HashMap(java.util.HashMap) BLangNodeVisitor(org.wso2.ballerinalang.compiler.tree.BLangNodeVisitor) ArrayList(java.util.ArrayList) TypeTags(org.wso2.ballerinalang.compiler.util.TypeTags) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) BLangConstrainedType(org.wso2.ballerinalang.compiler.tree.types.BLangConstrainedType) BType(org.wso2.ballerinalang.compiler.semantics.model.types.BType) BInvokableSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol) BFutureType(org.wso2.ballerinalang.compiler.semantics.model.types.BFutureType) DiagnosticPos(org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos) BArrayType(org.wso2.ballerinalang.compiler.semantics.model.types.BArrayType) SymbolEnv(org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv) BUnionType(org.wso2.ballerinalang.compiler.semantics.model.types.BUnionType) BJSONType(org.wso2.ballerinalang.compiler.semantics.model.types.BJSONType) Symbols(org.wso2.ballerinalang.compiler.semantics.model.symbols.Symbols) BLangFunctionTypeNode(org.wso2.ballerinalang.compiler.tree.types.BLangFunctionTypeNode) Name(org.wso2.ballerinalang.compiler.util.Name) ScopeEntry(org.wso2.ballerinalang.compiler.semantics.model.Scope.ScopeEntry) SymTag(org.wso2.ballerinalang.compiler.semantics.model.symbols.SymTag) DiagnosticCode(org.ballerinalang.util.diagnostic.DiagnosticCode) BTableType(org.wso2.ballerinalang.compiler.semantics.model.types.BTableType) BLangType(org.wso2.ballerinalang.compiler.tree.types.BLangType) SymbolTable(org.wso2.ballerinalang.compiler.semantics.model.SymbolTable) CompilerContext(org.wso2.ballerinalang.compiler.util.CompilerContext) BType(org.wso2.ballerinalang.compiler.semantics.model.types.BType) BTupleType(org.wso2.ballerinalang.compiler.semantics.model.types.BTupleType)

Example 2 with BLangTupleTypeNode

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

the class BLangPackageBuilder method addTupleType.

public void addTupleType(DiagnosticPos pos, Set<Whitespace> ws, int members) {
    BLangTupleTypeNode tupleTypeNode = (BLangTupleTypeNode) TreeBuilder.createTupleTypeNode();
    for (int i = 0; i < members; i++) {
        final BLangType member = (BLangType) this.typeNodeStack.pop();
        tupleTypeNode.memberTypeNodes.add(0, member);
    }
    tupleTypeNode.pos = pos;
    tupleTypeNode.addWS(ws);
    this.typeNodeStack.push(tupleTypeNode);
}
Also used : BLangTupleTypeNode(org.wso2.ballerinalang.compiler.tree.types.BLangTupleTypeNode) BLangType(org.wso2.ballerinalang.compiler.tree.types.BLangType) BLangAnnotationAttachmentPoint(org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachmentPoint) BLangEndpoint(org.wso2.ballerinalang.compiler.tree.BLangEndpoint)

Aggregations

BLangTupleTypeNode (org.wso2.ballerinalang.compiler.tree.types.BLangTupleTypeNode)2 BLangType (org.wso2.ballerinalang.compiler.tree.types.BLangType)2 ArrayList (java.util.ArrayList)1 EnumSet (java.util.EnumSet)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 Flag (org.ballerinalang.model.elements.Flag)1 SymbolKind (org.ballerinalang.model.symbols.SymbolKind)1 OperatorKind (org.ballerinalang.model.tree.OperatorKind)1 TypeKind (org.ballerinalang.model.types.TypeKind)1 DiagnosticCode (org.ballerinalang.util.diagnostic.DiagnosticCode)1 Scope (org.wso2.ballerinalang.compiler.semantics.model.Scope)1 NOT_FOUND_ENTRY (org.wso2.ballerinalang.compiler.semantics.model.Scope.NOT_FOUND_ENTRY)1 ScopeEntry (org.wso2.ballerinalang.compiler.semantics.model.Scope.ScopeEntry)1