Search in sources :

Example 11 with BLangVariable

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

the class SemanticAnalyzer method createVarDef.

private BLangVariableDef createVarDef(BLangVariable var) {
    BLangVariableDef varDefNode = new BLangVariableDef();
    varDefNode.var = var;
    varDefNode.pos = var.pos;
    return varDefNode;
}
Also used : BLangVariableDef(org.wso2.ballerinalang.compiler.tree.statements.BLangVariableDef)

Example 12 with BLangVariable

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

the class CodeGenerator method visitForkJoinParameterDefs.

private void visitForkJoinParameterDefs(BLangVariable parameterDef, SymbolEnv forkJoinEnv) {
    LocalVariableAttributeInfo localVariableAttributeInfo = new LocalVariableAttributeInfo(1);
    parameterDef.symbol.varIndex = getLVIndex(parameterDef.type.tag);
    this.genNode(parameterDef, forkJoinEnv);
    LocalVariableInfo localVariableDetails = this.getLocalVarAttributeInfo(parameterDef.symbol);
    localVariableAttributeInfo.localVars.add(localVariableDetails);
}
Also used : LocalVariableInfo(org.wso2.ballerinalang.programfile.LocalVariableInfo) LocalVariableAttributeInfo(org.wso2.ballerinalang.programfile.attributes.LocalVariableAttributeInfo)

Example 13 with BLangVariable

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

the class ASTBuilderUtil method createMatchStatementPattern.

static BLangMatchStmtPatternClause createMatchStatementPattern(DiagnosticPos pos, BLangVariable variable, BLangBlockStmt body) {
    BLangMatchStmtPatternClause patternClause = (BLangMatchStmtPatternClause) TreeBuilder.createMatchStatementPattern();
    patternClause.pos = pos;
    patternClause.variable = variable;
    patternClause.body = body;
    return patternClause;
}
Also used : BLangMatchStmtPatternClause(org.wso2.ballerinalang.compiler.tree.statements.BLangMatch.BLangMatchStmtPatternClause)

Example 14 with BLangVariable

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

the class ASTBuilderUtil method createVariableDef.

static BLangVariableDef createVariableDef(DiagnosticPos pos, BLangVariable variable) {
    final BLangVariableDef variableDef = (BLangVariableDef) TreeBuilder.createVariableDefinitionNode();
    variableDef.pos = pos;
    variableDef.var = variable;
    return variableDef;
}
Also used : BLangVariableDef(org.wso2.ballerinalang.compiler.tree.statements.BLangVariableDef)

Example 15 with BLangVariable

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

the class ASTBuilderUtil method createVariable.

static BLangVariable createVariable(DiagnosticPos pos, String name, BType type, BLangExpression expr, BVarSymbol varSymbol) {
    final BLangVariable varNode = (BLangVariable) TreeBuilder.createVariableNode();
    varNode.pos = pos;
    varNode.name = createIdentifier(pos, name);
    varNode.type = type;
    varNode.expr = expr;
    varNode.symbol = varSymbol;
    return varNode;
}
Also used : BLangVariable(org.wso2.ballerinalang.compiler.tree.BLangVariable)

Aggregations

BLangVariable (org.wso2.ballerinalang.compiler.tree.BLangVariable)77 ArrayList (java.util.ArrayList)21 BLangEndpoint (org.wso2.ballerinalang.compiler.tree.BLangEndpoint)20 BLangVariableDef (org.wso2.ballerinalang.compiler.tree.statements.BLangVariableDef)18 DiagnosticPos (org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos)18 BLangExpression (org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression)16 BLangAssignment (org.wso2.ballerinalang.compiler.tree.statements.BLangAssignment)15 BLangBlockStmt (org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt)14 BVarSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BVarSymbol)11 BType (org.wso2.ballerinalang.compiler.semantics.model.types.BType)10 BLangFunction (org.wso2.ballerinalang.compiler.tree.BLangFunction)10 BLangSimpleVarRef (org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef)10 BLangInvocation (org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation)9 BLangStruct (org.wso2.ballerinalang.compiler.tree.BLangStruct)8 Whitespace (org.ballerinalang.model.Whitespace)7 BLangObject (org.wso2.ballerinalang.compiler.tree.BLangObject)7 BLangRecordLiteral (org.wso2.ballerinalang.compiler.tree.expressions.BLangRecordLiteral)7 Name (org.wso2.ballerinalang.compiler.util.Name)7 HashMap (java.util.HashMap)6 BLangExpressionStmt (org.wso2.ballerinalang.compiler.tree.statements.BLangExpressionStmt)6