diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 00000000..0df17dd0 --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +6.2.1 \ No newline at end of file diff --git a/src/java/com/claro/ClaroLexer.flex b/src/java/com/claro/ClaroLexer.flex index 5659ef0d..ba0f81b9 100644 --- a/src/java/com/claro/ClaroLexer.flex +++ b/src/java/com/claro/ClaroLexer.flex @@ -51,7 +51,7 @@ import java.util.concurrent.atomic.AtomicReference; private Symbol symbol(int type, int lines, int columns, T value) { addToLine(value); final StringBuilder currentInputLineBuilder = currentInputLine.get(); - Symbol res = new Symbol(type, yycolumn, yyline, new LexedValue(value, () -> currentInputLineBuilder.toString(), columns)); + Symbol res = new Symbol(type, yycolumn, yyline, LexedValue.create(value, () -> currentInputLineBuilder.toString(), columns)); yyline += lines; yycolumn += columns; return res; @@ -338,7 +338,7 @@ PrivilegedInlineJava = [^]*\$\$END_JAVA string.setLength(0); addToLine("\""); final StringBuilder currentInputLineBuilder = currentInputLine.get(); - return new Symbol(Tokens.STRING, ++yycolumn - matchedString.length() - 2 , yyline, new LexedValue(matchedString, () -> currentInputLineBuilder.toString(), matchedString.length() + 2)); + return new Symbol(Tokens.STRING, ++yycolumn - matchedString.length() - 2 , yyline, LexedValue.create(matchedString, () -> currentInputLineBuilder.toString(), matchedString.length() + 2)); } [^\n\r\"\\{]+ { String parsed = yytext(); @@ -368,7 +368,7 @@ PrivilegedInlineJava = [^]*\$\$END_JAVA yycolumn++; addToLine("{"); final StringBuilder currentInputLineBuilder = currentInputLine.get(); - return new Symbol(Tokens.FMT_STRING_PART, yycolumn, yyline, new LexedValue(fmtStringPart, () -> currentInputLineBuilder.toString(), fmtStringPart.length() + 1)); + return new Symbol(Tokens.FMT_STRING_PART, yycolumn, yyline, LexedValue.create(fmtStringPart, () -> currentInputLineBuilder.toString(), fmtStringPart.length() + 1)); } } diff --git a/src/java/com/claro/ClaroParser.cup b/src/java/com/claro/ClaroParser.cup index cd8add84..d3e6bfaf 100644 --- a/src/java/com/claro/ClaroParser.cup +++ b/src/java/com/claro/ClaroParser.cup @@ -55,18 +55,18 @@ action code {: private Expr constructBinaryExpr(Expr a, LexedValue op, Integer opleft, Integer opright, Expr b, Function, BiFunction> constructor) { Supplier currentLinesSupplier = - joinExprLines(new Line(a.currentLine, a.currentLineNumber), new Line(op.currentInputLine, opright), new Line(b.currentLine, b.currentLineNumber)); + joinExprLines(new Line(a.currentLine, a.currentLineNumber), new Line(op.getCurrentInputLine(), opright), new Line(b.currentLine, b.currentLineNumber)); int startCol = min(a.startCol, opleft, b.startCol); - int endCol = max(a.endCol, opleft + op.len, b.endCol); + int endCol = max(a.endCol, opleft + op.getLen(), b.endCol); return constructor.apply(currentLinesSupplier).apply(startCol, endCol); } private CollectionSubscriptExpr constructCollectionSubscriptExpr(Expr l, LexedValue lb, int lbleft, int lbright, Expr e, LexedValue rb, int rbleft, int rbright) { Supplier currentLinesSupplier = - joinExprLines(new Line(l.currentLine, l.currentLineNumber), new Line(lb.currentInputLine, lbright), new Line(e.currentLine, e.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(l.currentLine, l.currentLineNumber), new Line(lb.getCurrentInputLine(), lbright), new Line(e.currentLine, e.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(l.startCol, lbleft, e.startCol, rbleft); - int endCol = max(l.endCol, lbleft + lb.len, e.endCol, rbleft + rb.len); + int endCol = max(l.endCol, lbleft + lb.getLen(), e.endCol, rbleft + rb.getLen()); return new CollectionSubscriptExpr(l, e, currentLinesSupplier, rbright, startCol, endCol); } @@ -76,43 +76,43 @@ action code {: ) { Supplier currentLinesSupplier = prompt.isPresent() - ? joinExprLines(new Line(i.currentInputLine, iright), new Line(lp.currentInputLine, lpright), new Line(prompt.get().currentInputLine, promptright), new Line(rp.currentInputLine, rpright)) - : joinExprLines(new Line(i.currentInputLine, iright), new Line(lp.currentInputLine, lpright), new Line(rp.currentInputLine, rpright)); + ? joinExprLines(new Line(i.getCurrentInputLine(), iright), new Line(lp.getCurrentInputLine(), lpright), new Line(prompt.get().getCurrentInputLine(), promptright), new Line(rp.getCurrentInputLine(), rpright)) + : joinExprLines(new Line(i.getCurrentInputLine(), iright), new Line(lp.getCurrentInputLine(), lpright), new Line(rp.getCurrentInputLine(), rpright)); int startCol = min(ileft, lpleft, prompt.isPresent() ? promptleft : Integer.MAX_VALUE, rpleft); - int endCol = max(ileft + i.len, lpleft + lp.len, prompt.isPresent() ? promptleft + prompt.get().len : -1, rpleft + rp.len); + int endCol = max(ileft + i.getLen(), lpleft + lp.getLen(), prompt.isPresent() ? promptleft + prompt.get().getLen() : -1, rpleft + rp.getLen()); - return new InputExpr(prompt.map(p -> p.val), currentLinesSupplier, rpright, startCol, endCol); + return new InputExpr(prompt.map(p -> p.getVal()), currentLinesSupplier, rpright, startCol, endCol); } private Expr constructSetOrTuple(LexedValue mut, int mutleft, int mutright, LexedValue lp, int lpleft, int lpright, Expr head, LexedValue c, int cleft, int cright, Symbol tailValues, LexedValue rp, int rpleft, int rpright, BiFunction, Supplier, BiFunction> constructor) { Supplier currentLinesSupplier = mut == null - ? joinExprLines(new Line(lp.currentInputLine, lpright), new Line(head.currentLine, head.currentLineNumber), new Line(c.currentInputLine, cright), new Line(((LexedValue) tailValues.value).currentInputLine, tailValues.right), new Line(rp.currentInputLine, rpright)) - : joinExprLines(new Line(mut.currentInputLine, mutright), new Line(lp.currentInputLine, lpright), new Line(head.currentLine, head.currentLineNumber), new Line(c.currentInputLine, cright), new Line(((LexedValue) tailValues.value).currentInputLine, tailValues.right), new Line(rp.currentInputLine, rpright)); + ? joinExprLines(new Line(lp.getCurrentInputLine(), lpright), new Line(head.currentLine, head.currentLineNumber), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue) tailValues.value).getCurrentInputLine(), tailValues.right), new Line(rp.getCurrentInputLine(), rpright)) + : joinExprLines(new Line(mut.getCurrentInputLine(), mutright), new Line(lp.getCurrentInputLine(), lpright), new Line(head.currentLine, head.currentLineNumber), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue) tailValues.value).getCurrentInputLine(), tailValues.right), new Line(rp.getCurrentInputLine(), rpright)); int startCol = min(mutleft, lpleft, head.startCol, cleft, tailValues.left, rpleft); int endCol = mut == null - ? max(lpleft + lp.len, head.endCol, cleft + c.len, tailValues.left + ((LexedValue) tailValues.value).len, rpleft + rp.len) - : max(mutleft + mut.len, lpleft + lp.len, head.endCol, cleft + c.len, tailValues.left + ((LexedValue) tailValues.value).len, rpleft + rp.len); + ? max(lpleft + lp.getLen(), head.endCol, cleft + c.getLen(), tailValues.left + ((LexedValue) tailValues.value).getLen(), rpleft + rp.getLen()) + : max(mutleft + mut.getLen(), lpleft + lp.getLen(), head.endCol, cleft + c.getLen(), tailValues.left + ((LexedValue) tailValues.value).getLen(), rpleft + rp.getLen()); ImmutableList.Builder values = ImmutableList.builder(); values.add(head); - values.addAll(((LexedValue>) tailValues.value).val.build().reverse()); + values.addAll(((LexedValue>) tailValues.value).getVal().build().reverse()); return constructor.apply(values.build(), currentLinesSupplier).apply(startCol, endCol); } private Symbol constructBuiltinType(LexedValue lb, int lbleft, int lbright, Symbol t, LexedValue rb, int rbleft, int rbright, Function, TypeProvider> typeProviderConstructor) { LexedValue tLexedVal = (LexedValue) t.value; Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(tLexedVal.currentInputLine, t.right), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(tLexedVal.getCurrentInputLine(), t.right), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(lbleft, t.left, rbleft); - int endCol = max(lbleft + lb.len, t.left + tLexedVal.len, rbleft + rb.len); + int endCol = max(lbleft + lb.getLen(), t.left + tLexedVal.getLen(), rbleft + rb.getLen()); return new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( typeProviderConstructor.apply(tLexedVal), currentLinesSupplier, endCol - startCol) @@ -163,14 +163,14 @@ parser code {: return; } System.err.print(String.format("%s.claro:%s: ", generatedClassName, currSymbol.right + 1)); - System.err.println("Unexpected token <" + lexedValue.val + ">"); - String currentInputLineString = lexedValue.currentInputLine.get(); + System.err.println("Unexpected token <" + lexedValue.getVal() + ">"); + String currentInputLineString = lexedValue.getCurrentInputLine().get(); if (Character.isWhitespace(currentInputLineString.charAt(currentInputLineString.length() - 1))) { int trailingWhitespaceStart = currentInputLineString.length(); while (Character.isWhitespace(currentInputLineString.charAt(--trailingWhitespaceStart))); // This is just cute for the sake of it....barf...but I'm keeping it lol. System.err.println(currentInputLineString.substring(0, trailingWhitespaceStart + 1)); } else { - System.err.println(lexedValue.currentInputLine.get()); + System.err.println(lexedValue.getCurrentInputLine().get()); } System.err.println(Strings.repeat(" ", currSymbol.left) + '^'); }); @@ -195,7 +195,7 @@ parser code {: } Line(Symbol s) { - this(((LexedValue)s.value).currentInputLine, s.right); + this(((LexedValue)s.value).getCurrentInputLine(), s.right); } Line(Supplier inputLineSupplier, int inputLineNumber) { @@ -228,21 +228,21 @@ parser code {: int maxLine = Integer.MIN_VALUE; // max line for (int i = 0; i inputLinesSupplier = () -> { StringBuilder inputLines = new StringBuilder(); - symbolStream.map(s -> ((LexedValue)s.value).currentInputLine).forEach(inputLines::append); + symbolStream.map(s -> ((LexedValue)s.value).getCurrentInputLine()).forEach(inputLines::append); return inputLines.toString(); }; return new Symbol( -1, // Really I just have no better value to put in here. minStartCol, maxLine, - new LexedValue(value, inputLinesSupplier, aggregateLen) + LexedValue.create(value, inputLinesSupplier, aggregateLen) ); } @@ -632,12 +632,12 @@ stmt ::= module_definition_stmt ::= MODULE IDENTIFIER:i LCURLY bind_stmts_list:b RCURLY - {: RESULT = new ModuleDefinitionStmt(i.val, b); :} + {: RESULT = new ModuleDefinitionStmt(i.getVal(), b); :} | MODULE IDENTIFIER:i USING LPAR identifier_list:modules RPAR LCURLY bind_stmts_list:b RCURLY {: ImmutableList moduleList = - ((LexedValue>)modules.value).val.build().reverse(); - RESULT = new ModuleDefinitionStmt(i.val, Optional.of(moduleList), b); + ((LexedValue>)modules.value).getVal().build().reverse(); + RESULT = new ModuleDefinitionStmt(i.getVal(), Optional.of(moduleList), b); :} ; @@ -650,14 +650,14 @@ bind_stmts_list ::= bind_stmt ::= BIND IDENTIFIER:i COLON builtin_type:t TO expr:e SEMICOLON - {: RESULT = new BindStmt(i.val, ((LexedValue) t.value).val, e); :} + {: RESULT = new BindStmt(i.getVal(), ((LexedValue) t.value).getVal(), e); :} ; using_block_stmt ::= USING LPAR identifier_list:modules RPAR LCURLY stmt_list:s RCURLY {: ImmutableList moduleList = - ((LexedValue>)modules.value).val.build().reverse(); + ((LexedValue>)modules.value).getVal().build().reverse(); RESULT = new UsingBlockStmt(moduleList, s, true); :} ; @@ -675,39 +675,39 @@ show_type ::= unwrap_expr ::= UNWRAP:u LPAR:l expr:expr RPAR:r {: - Supplier currentLinesSupplier = joinExprLines(new Line(u.currentInputLine, uright), new Line(l.currentInputLine, lright), new Line(expr), new Line(r.currentInputLine, rright)); + Supplier currentLinesSupplier = joinExprLines(new Line(u.getCurrentInputLine(), uright), new Line(l.getCurrentInputLine(), lright), new Line(expr), new Line(r.getCurrentInputLine(), rright)); int startCol = min(uleft, lleft, expr.startCol, rleft); - int endCol = max(uleft + u.len, lleft + l.len, expr.endCol, rleft + r.len); + int endCol = max(uleft + u.getLen(), lleft + l.getLen(), expr.endCol, rleft + r.getLen()); RESULT = new UnwrapUserDefinedTypeExpr(expr, currentLinesSupplier, rright, startCol, endCol); :} ; identifier_declaration ::= VAR IDENTIFIER:identifier ASSIGNMENT expr:e SEMICOLON - {: RESULT = new DeclarationStmt(identifier.val, e); :} + {: RESULT = new DeclarationStmt(identifier.getVal(), e); :} | VAR IDENTIFIER:identifier COLON builtin_type:t SEMICOLON - {: RESULT = new DeclarationStmt(identifier.val, ((LexedValue) t.value).val); :} + {: RESULT = new DeclarationStmt(identifier.getVal(), ((LexedValue) t.value).getVal()); :} | VAR IDENTIFIER:identifier COLON builtin_type:t ASSIGNMENT expr:e SEMICOLON - {: RESULT = new DeclarationStmt(identifier.val, ((LexedValue) t.value).val, e); :} + {: RESULT = new DeclarationStmt(identifier.getVal(), ((LexedValue) t.value).getVal(), e); :} // Blocking variants. | VAR IDENTIFIER:identifier COLON builtin_type:t BLOCKING_GET expr:e SEMICOLON - {: RESULT = new DeclarationStmt(identifier.val, ((LexedValue) t.value).val, e, /*allowVariableHiding=*/false, /*blocking=*/true, /*errorProp=*/false); :} + {: RESULT = new DeclarationStmt(identifier.getVal(), ((LexedValue) t.value).getVal(), e, /*allowVariableHiding=*/false, /*blocking=*/true, /*errorProp=*/false); :} | VAR IDENTIFIER:identifier BLOCKING_GET expr:e SEMICOLON - {: RESULT = new DeclarationStmt(identifier.val, e, /*blocking=*/true, /*errorProp=*/false); :} + {: RESULT = new DeclarationStmt(identifier.getVal(), e, /*blocking=*/true, /*errorProp=*/false); :} // Automatic error propagation variants. | VAR IDENTIFIER:identifier COLON builtin_type:t QUESTION_MARK_ASSIGNMENT expr:e SEMICOLON - {: RESULT = new DeclarationStmt(identifier.val, ((LexedValue) t.value).val, e, /*allowVariableHiding=*/false, /*blocking=*/false, /*errorProp=*/true); :} + {: RESULT = new DeclarationStmt(identifier.getVal(), ((LexedValue) t.value).getVal(), e, /*allowVariableHiding=*/false, /*blocking=*/false, /*errorProp=*/true); :} | VAR IDENTIFIER:identifier QUESTION_MARK_ASSIGNMENT expr:e SEMICOLON - {: RESULT = new DeclarationStmt(identifier.val, e, /*blocking=*/false, /*errorProp=*/true); :} + {: RESULT = new DeclarationStmt(identifier.getVal(), e, /*blocking=*/false, /*errorProp=*/true); :} ; alias_stmt ::= ALIAS IDENTIFIER:alias COLON builtin_type:aliased_type {: LexedValue aliasedTypeLexedVal = (LexedValue) aliased_type.value; - RESULT = new AliasStmt(alias.val, aliasedTypeLexedVal.val); + RESULT = new AliasStmt(alias.getVal(), aliasedTypeLexedVal.getVal()); :} ; @@ -720,26 +720,26 @@ newtype_def_stmt ::= NEWTYPE IDENTIFIER:type_name COLON builtin_type:base_type {: LexedValue baseTypeLexedVal = (LexedValue) base_type.value; - RESULT = new NewTypeDefStmt(type_name.val, baseTypeLexedVal.val); + RESULT = new NewTypeDefStmt(type_name.getVal(), baseTypeLexedVal.getVal()); :} | NEWTYPE IDENTIFIER:type_name L_ANGLE_BRACKET identifier_list:parameterized_type_names R_ANGLE_BRACKET COLON builtin_type:base_type {: LexedValue baseTypeLexedVal = (LexedValue) base_type.value; - RESULT = new NewTypeDefStmt(type_name.val, baseTypeLexedVal.val, ((LexedValue>)parameterized_type_names.value).val.build().reverse()); + RESULT = new NewTypeDefStmt(type_name.getVal(), baseTypeLexedVal.getVal(), ((LexedValue>)parameterized_type_names.value).getVal().build().reverse()); :} ; initializers_block_stmt ::= INITIALIZERS:i IDENTIFIER:initialized_type LCURLY:lc initializers_or_unwrappers_proc_defs_list:initializer_defs RCURLY:rc {: - RESULT = new InitializersBlockStmt(initialized_type.val, initializer_defs.build().reverse()); + RESULT = new InitializersBlockStmt(initialized_type.getVal(), initializer_defs.build().reverse()); :} ; unwrappers_block_stmt ::= UNWRAPPERS:u IDENTIFIER:unwrapped_type LCURLY:lc initializers_or_unwrappers_proc_defs_list:unwrapper_defs RCURLY:rc {: - RESULT = new UnwrappersBlockStmt(unwrapped_type.val, unwrapper_defs.build().reverse()); + RESULT = new UnwrappersBlockStmt(unwrapped_type.getVal(), unwrapper_defs.build().reverse()); :} ; @@ -785,9 +785,9 @@ builtin_type ::= | MUT:m base_builtin_type_without_mutability_modifier:base_type {: RESULT = constructBuiltinType( - m, mleft, mright, base_type, new LexedValue("", () -> "", 0), base_type.left + ((LexedValue) base_type.value).len, base_type.right, + m, mleft, mright, base_type, LexedValue.create("", () -> "", 0), base_type.left + ((LexedValue) base_type.value).getLen(), base_type.right, tLexedVal -> (TypeProvider) (scopedHeap) -> { - Type resolvedType = tLexedVal.val.resolveType(scopedHeap); + Type resolvedType = tLexedVal.getVal().resolveType(scopedHeap); // Literally all I need to do is manually mark the thing mutable if mutability is supported for this type. if (resolvedType instanceof SupportsMutableVariant) { return ((SupportsMutableVariant) resolvedType).toShallowlyMutableVariant(); @@ -808,10 +808,10 @@ base_builtin_type_without_mutability_modifier ::= -1, tleft, tright, // line number - new LexedValue( + LexedValue.create( (TypeProvider) ImmediateTypeProvider.of(Types.INTEGER), - t.currentInputLine, - t.len) + t.getCurrentInputLine(), + t.getLen()) ); :} | FLOAT_TYPE:t @@ -820,10 +820,10 @@ base_builtin_type_without_mutability_modifier ::= -1, tleft, tright, // line number - new LexedValue( + LexedValue.create( (TypeProvider) ImmediateTypeProvider.of(Types.FLOAT), - t.currentInputLine, - t.len) + t.getCurrentInputLine(), + t.getLen()) ); :} | BOOLEAN_TYPE:t @@ -832,10 +832,10 @@ base_builtin_type_without_mutability_modifier ::= -1, tleft, tright, // line number - new LexedValue( + LexedValue.create( (TypeProvider) ImmediateTypeProvider.of(Types.BOOLEAN), - t.currentInputLine, - t.len) + t.getCurrentInputLine(), + t.getLen()) ); :} | STRING_TYPE:t @@ -844,10 +844,10 @@ base_builtin_type_without_mutability_modifier ::= -1, tleft, tright, // line number - new LexedValue( + LexedValue.create( (TypeProvider) ImmediateTypeProvider.of(Types.STRING), - t.currentInputLine, - t.len) + t.getCurrentInputLine(), + t.getLen()) ); :} | LBRACKET:lb builtin_type:t RBRACKET:rb @@ -857,7 +857,7 @@ base_builtin_type_without_mutability_modifier ::= tLexedVal -> (TypeProvider) (scopedHeap) -> { boolean impossibleRecursionAlreadyFoundOnLevel = scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND"); - Type resolvedType = Types.ListType.forValueType(tLexedVal.val.resolveType(scopedHeap)); + Type resolvedType = Types.ListType.forValueType(tLexedVal.getVal().resolveType(scopedHeap)); // Recursive aliases are allowed to be defined within this type since it has an implicit "bottom". But // it doesn't matter if we've already found impossible, unresolved recursion on this level. if (!impossibleRecursionAlreadyFoundOnLevel && scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND")) { @@ -873,7 +873,7 @@ base_builtin_type_without_mutability_modifier ::= tLexedVal -> (TypeProvider) (scopedHeap) -> { boolean impossibleRecursionAlreadyFoundOnLevel = scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND"); - Type resolvedType = Types.SetType.forValueType(tLexedVal.val.resolveType(scopedHeap)); + Type resolvedType = Types.SetType.forValueType(tLexedVal.getVal().resolveType(scopedHeap)); // Recursive aliases are allowed to be defined within this type since it has an implicit "bottom". But // it doesn't matter if we've already found impossible, unresolved recursion on this level. if (!impossibleRecursionAlreadyFoundOnLevel && scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND")) { @@ -889,19 +889,19 @@ base_builtin_type_without_mutability_modifier ::= LexedValue keyLexedVal = (LexedValue) key.value; LexedValue valueLexedVal = (LexedValue) value.value; Supplier currentLinesSupplier = - joinExprLines(new Line(la.currentInputLine, laright), new Line(keyLexedVal.currentInputLine, key.right), new Line(c.currentInputLine, cright), new Line(valueLexedVal.currentInputLine, value.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(la.getCurrentInputLine(), laright), new Line(keyLexedVal.getCurrentInputLine(), key.right), new Line(c.getCurrentInputLine(), cright), new Line(valueLexedVal.getCurrentInputLine(), value.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(laleft, key.left, cleft, value.left, raleft); - int endCol = max(laleft + la.len, key.left + keyLexedVal.len, cleft + c.len, value.left + valueLexedVal.len, raleft + ra.len); + int endCol = max(laleft + la.getLen(), key.left + keyLexedVal.getLen(), cleft + c.getLen(), value.left + valueLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( (TypeProvider) (scopedHeap) -> { boolean impossibleRecursionAlreadyFoundOnLevel = scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND"); - Type resolvedType = Types.MapType.forKeyValueTypes(keyLexedVal.val.resolveType(scopedHeap), valueLexedVal.val.resolveType(scopedHeap)); + Type resolvedType = Types.MapType.forKeyValueTypes(keyLexedVal.getVal().resolveType(scopedHeap), valueLexedVal.getVal().resolveType(scopedHeap)); // Recursive aliases are allowed to be defined within this type since it has an implicit "bottom". But // it doesn't matter if we've already found impossible, unresolved recursion on this level. if (!impossibleRecursionAlreadyFoundOnLevel && scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND")) { @@ -917,16 +917,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg_types.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg_types.left + argTypesLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg_types.left + argTypesLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.OneofType.forVariantTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList())), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.OneofType.forVariantTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList())), currentLinesSupplier, endCol - startCol) ); @@ -936,16 +936,16 @@ base_builtin_type_without_mutability_modifier ::= LexedValue argLexedVal = (LexedValue) arg.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argLexedVal.currentInputLine, arg.right), new Line(a.currentInputLine, aright), new Line(outputTypeLexedVal.currentInputLine, output_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argLexedVal.getCurrentInputLine(), arg.right), new Line(a.getCurrentInputLine(), aright), new Line(outputTypeLexedVal.getCurrentInputLine(), output_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg.left, aleft, output_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg.left + argLexedVal.len, aleft + a.len, output_type.left + outputTypeLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg.left + argLexedVal.getLen(), aleft + a.getLen(), output_type.left + outputTypeLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.val.resolveType(scopedHeap)), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.getVal().resolveType(scopedHeap)), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), currentLinesSupplier, endCol - startCol) ); @@ -955,16 +955,16 @@ base_builtin_type_without_mutability_modifier ::= LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(b1.currentInputLine, b1right), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(b2.currentInputLine, b2right), new Line(a.currentInputLine, aright), new Line(outputTypeLexedVal.currentInputLine, output_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(b1.getCurrentInputLine(), b1right), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(b2.getCurrentInputLine(), b2right), new Line(a.getCurrentInputLine(), aright), new Line(outputTypeLexedVal.getCurrentInputLine(), output_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, b1left, arg_types.left, b2left, aleft, output_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, b1left + b1.len, arg_types.left + argTypesLexedVal.len, b2left + b2.len, aleft + a.len, output_type.left + outputTypeLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), b1left + b1.getLen(), arg_types.left + argTypesLexedVal.getLen(), b2left + b2.getLen(), aleft + a.getLen(), output_type.left + outputTypeLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), currentLinesSupplier, endCol - startCol) ); @@ -974,16 +974,16 @@ base_builtin_type_without_mutability_modifier ::= LexedValue argLexedVal = (LexedValue) arg.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argLexedVal.currentInputLine, arg.right), new Line(a.currentInputLine, aright), new Line(outputTypeLexedVal.currentInputLine, output_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argLexedVal.getCurrentInputLine(), arg.right), new Line(a.getCurrentInputLine(), aright), new Line(outputTypeLexedVal.getCurrentInputLine(), output_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg.left, aleft, output_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg.left + argLexedVal.len, aleft + a.len, output_type.left + outputTypeLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg.left + argLexedVal.getLen(), aleft + a.getLen(), output_type.left + outputTypeLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.val.resolveType(scopedHeap)), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.getVal().resolveType(scopedHeap)), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), currentLinesSupplier, endCol - startCol) ); @@ -993,16 +993,16 @@ base_builtin_type_without_mutability_modifier ::= LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(b1.currentInputLine, b1right), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(b2.currentInputLine, b2right), new Line(a.currentInputLine, aright), new Line(outputTypeLexedVal.currentInputLine, output_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(b1.getCurrentInputLine(), b1right), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(b2.getCurrentInputLine(), b2right), new Line(a.getCurrentInputLine(), aright), new Line(outputTypeLexedVal.getCurrentInputLine(), output_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, b1left, arg_types.left, b2left, aleft, output_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, b1left + b1.len, arg_types.left + argTypesLexedVal.len, b2left + b2.len, aleft + a.len, output_type.left + outputTypeLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), b1left + b1.getLen(), arg_types.left + argTypesLexedVal.getLen(), b2left + b2.getLen(), aleft + a.getLen(), output_type.left + outputTypeLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), currentLinesSupplier, endCol - startCol) ); @@ -1011,16 +1011,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg_types.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg_types.left + argTypesLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg_types.left + argTypesLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/false), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/false), currentLinesSupplier, endCol - startCol) ); @@ -1029,16 +1029,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg_types.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg_types.left + argTypesLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg_types.left + argTypesLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/true), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/true), currentLinesSupplier, endCol - startCol) ); @@ -1047,16 +1047,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue returnTypeProvider = (LexedValue) return_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(returnTypeProvider.currentInputLine, return_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(returnTypeProvider.getCurrentInputLine(), return_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, return_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, return_type.left + returnTypeProvider.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), return_type.left + returnTypeProvider.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(returnTypeProvider.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(returnTypeProvider.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), currentLinesSupplier, endCol - startCol) ); @@ -1065,16 +1065,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue returnTypeProvider = (LexedValue) return_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(returnTypeProvider.currentInputLine, return_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(returnTypeProvider.getCurrentInputLine(), return_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, return_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, return_type.left + returnTypeProvider.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), return_type.left + returnTypeProvider.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(returnTypeProvider.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(returnTypeProvider.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), currentLinesSupplier, endCol - startCol) ); @@ -1083,16 +1083,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg_types.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg_types.left + argTypesLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg_types.left + argTypesLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.TupleType.forValueTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList())), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.TupleType.forValueTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList())), currentLinesSupplier, endCol - startCol) ); @@ -1101,16 +1101,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue wrappedTypeProvider = (LexedValue) wrapped.value; Supplier currentLinesSupplier = - joinExprLines(new Line(f.currentInputLine, fright), new Line(la.currentInputLine, laright), new Line(wrappedTypeProvider.currentInputLine, wrapped.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(f.getCurrentInputLine(), fright), new Line(la.getCurrentInputLine(), laright), new Line(wrappedTypeProvider.getCurrentInputLine(), wrapped.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(fleft, laleft, wrapped.left, raleft); - int endCol = max(fleft + f.len, laleft + la.len, wrapped.left + wrappedTypeProvider.len, raleft + ra.len); + int endCol = max(fleft + f.getLen(), laleft + la.getLen(), wrapped.left + wrappedTypeProvider.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.FutureType.wrapping(wrappedTypeProvider.val.resolveType(scopedHeap)), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.FutureType.wrapping(wrappedTypeProvider.getVal().resolveType(scopedHeap)), currentLinesSupplier, endCol - startCol) ); @@ -1121,28 +1121,28 @@ base_builtin_type_without_mutability_modifier ::= -1, type_nameleft, type_nameright, // line number - new LexedValue( - TypeProvider.Util.getTypeByName(type_name.val, /*isTypeDefinition=*/true), - type_name.currentInputLine, - type_name.len) + LexedValue.create( + TypeProvider.Util.getTypeByName(type_name.getVal(), /*isTypeDefinition=*/true), + type_name.getCurrentInputLine(), + type_name.getLen()) ); :} | IDENTIFIER:type_name L_ANGLE_BRACKET:la builtin_types_list:concrete_type_params R_ANGLE_BRACKET:ra {: LexedValue> concreteTypeParamsLexedVal = (LexedValue>) concrete_type_params.value; Supplier currentLinesSupplier = - joinExprLines(new Line(type_name.currentInputLine, type_nameright), new Line(la.currentInputLine, laright), new Line(concreteTypeParamsLexedVal.currentInputLine, concrete_type_params.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(type_name.getCurrentInputLine(), type_nameright), new Line(la.getCurrentInputLine(), laright), new Line(concreteTypeParamsLexedVal.getCurrentInputLine(), concrete_type_params.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(type_nameleft, laleft, concrete_type_params.left, raleft); - int endCol = max(type_nameleft + type_name.len, laleft + la.len, concrete_type_params.left + concreteTypeParamsLexedVal.len, raleft + ra.len); + int endCol = max(type_nameleft + type_name.getLen(), laleft + la.getLen(), concrete_type_params.left + concreteTypeParamsLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( (TypeProvider) (scopedHeap) -> Types.UserDefinedType.forTypeNameAndParameterizedTypes( - type_name.val, - concreteTypeParamsLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()) + type_name.getVal(), + concreteTypeParamsLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()) ), currentLinesSupplier, endCol - startCol) @@ -1154,19 +1154,19 @@ base_builtin_type_without_mutability_modifier ::= // in turn is intended to resemble a sequence of variable initializations. I appreciate the metaphore of a struct as // a bundle of variables. {: - ImmutableList> fieldTypesList = ((LexedValue>) fields.value).val.build().entrySet().asList().reverse(); + ImmutableList> fieldTypesList = ((LexedValue>) fields.value).getVal().build().entrySet().asList().reverse(); ImmutableMap fieldTypesMap = ImmutableMap.builderWithExpectedSize(fieldTypesList.size()).putAll(fieldTypesList).build(); Supplier currentLinesSupplier = - joinExprLines(new Line(s.currentInputLine, sright), new Line(la.currentInputLine, laright), new Line(((LexedValue) fields.value).currentInputLine, fields.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(s.getCurrentInputLine(), sright), new Line(la.getCurrentInputLine(), laright), new Line(((LexedValue) fields.value).getCurrentInputLine(), fields.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(sleft, laleft, fields.left, raleft); - int endCol = max(sleft + s.len, laleft + la.len, fields.left + ((LexedValue) fields.value).len, raleft + ra.len); + int endCol = max(sleft + s.getLen(), laleft + la.getLen(), fields.left + ((LexedValue) fields.value).getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( (TypeProvider) (scopedHeap) -> Types.StructType.forFieldTypes( fieldTypesMap.keySet().asList(), @@ -1183,19 +1183,19 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue httpServiceLex = (LexedValue)http_service.value; Supplier currentLinesSupplier = - joinExprLines(new Line(h.currentInputLine, hright), new Line(la.currentInputLine, laright), new Line(httpServiceLex.currentInputLine, http_serviceright), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(h.getCurrentInputLine(), hright), new Line(la.getCurrentInputLine(), laright), new Line(httpServiceLex.getCurrentInputLine(), http_serviceright), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(hleft, laleft, http_serviceleft, raleft); - int endCol = max(hleft + h.len, laleft + la.len, http_serviceleft + httpServiceLex.len, raleft + ra.len); + int endCol = max(hleft + h.getLen(), laleft + la.getLen(), http_serviceleft + httpServiceLex.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( (TypeProvider) (scopedHeap) -> { // First things first, I need to actually do some type validation that this type has been correctly // parameterized with an HttpService and not some arbitrary type. - Type resolvedHttpServiceType = httpServiceLex.val.resolveType(scopedHeap); + Type resolvedHttpServiceType = httpServiceLex.getVal().resolveType(scopedHeap); if (!resolvedHttpServiceType.baseType().equals(BaseType.HTTP_SERVICE)) { throw new RuntimeException( ClaroTypeException.forIllegalHttpClientTypeWithNonHttpServiceParameterizedType(resolvedHttpServiceType) @@ -1211,17 +1211,17 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue wrappedTypeProvider = (LexedValue) wrapped.value; Supplier currentLinesSupplier = - joinExprLines(new Line(f.currentInputLine, fright), new Line(la.currentInputLine, laright), new Line(wrappedTypeProvider.currentInputLine, wrapped.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(f.getCurrentInputLine(), fright), new Line(la.getCurrentInputLine(), laright), new Line(wrappedTypeProvider.getCurrentInputLine(), wrapped.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(fleft, laleft, wrapped.left, raleft); - int endCol = max(fleft + f.len, laleft + la.len, wrapped.left + wrappedTypeProvider.len, raleft + ra.len); + int endCol = max(fleft + f.getLen(), laleft + la.getLen(), wrapped.left + wrappedTypeProvider.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( (TypeProvider) (scopedHeap) -> { - Type resolvedHttpServiceType = wrappedTypeProvider.val.resolveType(scopedHeap); + Type resolvedHttpServiceType = wrappedTypeProvider.getVal().resolveType(scopedHeap); if (!resolvedHttpServiceType.baseType().equals(BaseType.HTTP_SERVICE)) { throw new RuntimeException( ClaroTypeException.forIllegalHttpServerTypeWithNonHttpServiceParameterizedType(resolvedHttpServiceType) @@ -1243,10 +1243,10 @@ builtin_types_list ::= -1, b.left, b.right, // line number - new LexedValue( - bLexedValue.val.build().reverse(), - bLexedValue.currentInputLine, - bLexedValue.len) + LexedValue.create( + bLexedValue.getVal().build().reverse(), + bLexedValue.getCurrentInputLine(), + bLexedValue.getLen()) ); :} ; @@ -1257,18 +1257,18 @@ backwards_builtin_types_list ::= LexedValue tLexedVal = (LexedValue)t.value; LexedValue> tailLexedVal = (LexedValue>)tail.value; Supplier currentLinesSupplier = - joinExprLines(new Line(tLexedVal.currentInputLine, t.right), new Line(c.currentInputLine, cright), new Line(tailLexedVal.currentInputLine, tail.right)); + joinExprLines(new Line(tLexedVal.getCurrentInputLine(), t.right), new Line(c.getCurrentInputLine(), cright), new Line(tailLexedVal.getCurrentInputLine(), tail.right)); int startCol = min(t.left, cleft, tail.left); - int endCol = max(t.left + tLexedVal.len, cleft + c.len, tail.left + tailLexedVal.len); + int endCol = max(t.left + tLexedVal.getLen(), cleft + c.getLen(), tail.left + tailLexedVal.getLen()); RESULT = new Symbol( -1, startCol, tail.right, // line number - new LexedValue( - tailLexedVal.val.add(tLexedVal.val), + LexedValue.create( + tailLexedVal.getVal().add(tLexedVal.getVal()), currentLinesSupplier, - tailLexedVal.len) + tailLexedVal.getLen()) ); :} | builtin_type:t @@ -1277,10 +1277,10 @@ backwards_builtin_types_list ::= -1, t.left, t.right, // line number - new LexedValue( - ImmutableList.builder().add(((LexedValue) t.value).val), - ((LexedValue)t.value).currentInputLine, - ((LexedValue)t.value).len) + LexedValue.create( + ImmutableList.builder().add(((LexedValue) t.value).getVal()), + ((LexedValue)t.value).getCurrentInputLine(), + ((LexedValue)t.value).getLen()) ); :} ; @@ -1306,18 +1306,18 @@ identifier_increment ::= INCREMENT:inc identifier:i {: Supplier currentLinesSupplier = - joinExprLines(new Line(inc.currentInputLine, incright), new Line(i.currentLine, i.currentLineNumber)); + joinExprLines(new Line(inc.getCurrentInputLine(), incright), new Line(i.currentLine, i.currentLineNumber)); int startCol = min(incleft, i.startCol); - int endCol = max(incleft + inc.len, i.endCol); + int endCol = max(incleft + inc.getLen(), i.endCol); RESULT = new IncrementExpr(i, /*preIncrement=*/true, currentLinesSupplier, i.currentLineNumber, startCol, endCol); :} | identifier:i INCREMENT:inc {: Supplier currentLinesSupplier = - joinExprLines(new Line(i.currentLine, i.currentLineNumber), new Line(inc.currentInputLine, incright)); + joinExprLines(new Line(i.currentLine, i.currentLineNumber), new Line(inc.getCurrentInputLine(), incright)); int startCol = min(i.startCol, incleft); - int endCol = max(i.endCol, incleft + inc.len); + int endCol = max(i.endCol, incleft + inc.getLen()); RESULT = new IncrementExpr(i, /*preIncrement=*/false, currentLinesSupplier, incright, startCol, endCol); :} @@ -1332,18 +1332,18 @@ identifier_decrement ::= DECREMENT:d identifier:i {: Supplier currentLinesSupplier = - joinExprLines(new Line(d.currentInputLine, dright), new Line(i.currentLine, i.currentLineNumber)); + joinExprLines(new Line(d.getCurrentInputLine(), dright), new Line(i.currentLine, i.currentLineNumber)); int startCol = min(dleft, i.startCol); - int endCol = max(dleft + d.len, i.endCol); + int endCol = max(dleft + d.getLen(), i.endCol); RESULT = new DecrementExpr(i, /*preDecrement=*/true, currentLinesSupplier, i.currentLineNumber, startCol, endCol); :} | identifier:i DECREMENT:d {: Supplier currentLinesSupplier = - joinExprLines(new Line(i.currentLine, i.currentLineNumber), new Line(d.currentInputLine, dright)); + joinExprLines(new Line(i.currentLine, i.currentLineNumber), new Line(d.getCurrentInputLine(), dright)); int startCol = min(i.startCol, dleft); - int endCol = max(i.endCol, dleft + d.len); + int endCol = max(i.endCol, dleft + d.getLen()); RESULT = new DecrementExpr(i, /*preDecrement=*/false, currentLinesSupplier, dright, startCol, endCol); :} @@ -1360,9 +1360,9 @@ list_remove_expr ::= REMOVE:r LPAR:lp expr:l COMMA:c expr:e RPAR:rp {: Supplier currentLinesSupplier = - joinExprLines(new Line(r.currentInputLine, rright), new Line(lp.currentInputLine, lpright), new Line(l), new Line(c.currentInputLine, cright), new Line(e), new Line(rp.currentInputLine, rpright)); + joinExprLines(new Line(r.getCurrentInputLine(), rright), new Line(lp.getCurrentInputLine(), lpright), new Line(l), new Line(c.getCurrentInputLine(), cright), new Line(e), new Line(rp.getCurrentInputLine(), rpright)); int startCol = min(rleft, lpleft, l.startCol, cleft, e.startCol, rpleft); - int endCol = max(rleft + r.len, lpleft + lp.len, l.endCol, cleft + c.len, e.endCol, rpleft + rp.len); + int endCol = max(rleft + r.getLen(), lpleft + lp.getLen(), l.endCol, cleft + c.getLen(), e.endCol, rpleft + rp.getLen()); RESULT = new RemoveElementFromListExpr(l, e, currentLinesSupplier, rpright, startCol, endCol); :} @@ -1383,9 +1383,9 @@ non_lambda_exprs ::= MINUS:m expr:e {: Supplier currentLinesSupplier = - joinExprLines(new Line(m.currentInputLine, mright), new Line(e.currentLine, e.currentLineNumber)); + joinExprLines(new Line(m.getCurrentInputLine(), mright), new Line(e.currentLine, e.currentLineNumber)); int startCol = min(mleft, e.startCol); - int endCol = max(mleft + m.len, e.endCol); + int endCol = max(mleft + m.getLen(), e.endCol); RESULT = new NegateNumericExpr(e, currentLinesSupplier, e.currentLineNumber, startCol, endCol); :} @@ -1426,27 +1426,27 @@ non_lambda_exprs ::= | LOG_PREFIX:log float:float_base LPAR:lp expr:arg RPAR:rp {: Supplier currentLinesSupplier = - joinExprLines(new Line(log.currentInputLine, logright), new Line(float_base.currentLine, float_base.currentLineNumber), new Line(lp.currentInputLine, lpright), new Line(arg.currentLine, arg.currentLineNumber), new Line(rp.currentInputLine, rpright)); + joinExprLines(new Line(log.getCurrentInputLine(), logright), new Line(float_base.currentLine, float_base.currentLineNumber), new Line(lp.getCurrentInputLine(), lpright), new Line(arg.currentLine, arg.currentLineNumber), new Line(rp.getCurrentInputLine(), rpright)); int startCol = min(logleft, float_base.startCol, lpleft, arg.startCol, rpleft); - int endCol = max(logleft + log.len, float_base.endCol, lpleft + lp.len, arg.endCol, rpleft + rp.len); + int endCol = max(logleft + log.getLen(), float_base.endCol, lpleft + lp.getLen(), arg.endCol, rpleft + rp.getLen()); RESULT = new LogNumericExpr(arg, float_base, currentLinesSupplier, rpright, startCol, endCol); :} | LOG_PREFIX:log integer:int_base LPAR:lp expr:arg RPAR:rp {: Supplier currentLinesSupplier = - joinExprLines(new Line(log.currentInputLine, logright), new Line(int_base.currentLine, int_base.currentLineNumber), new Line(lp.currentInputLine, lpright), new Line(arg.currentLine, arg.currentLineNumber), new Line(rp.currentInputLine, rpright)); + joinExprLines(new Line(log.getCurrentInputLine(), logright), new Line(int_base.currentLine, int_base.currentLineNumber), new Line(lp.getCurrentInputLine(), lpright), new Line(arg.currentLine, arg.currentLineNumber), new Line(rp.getCurrentInputLine(), rpright)); int startCol = min(logleft, int_base.startCol, lpleft, arg.startCol, rpleft); - int endCol = max(logleft + log.len, int_base.endCol, lpleft + lp.len, arg.endCol, rpleft + rp.len); + int endCol = max(logleft + log.getLen(), int_base.endCol, lpleft + lp.getLen(), arg.endCol, rpleft + rp.getLen()); RESULT = new LogNumericExpr(arg, int_base, currentLinesSupplier, rpright, startCol, endCol); :} | NUMERIC_BOOL:num LPAR:lp expr:b RPAR:rp {: Supplier currentLinesSupplier = - joinExprLines(new Line(num.currentInputLine, numright), new Line(lp.currentInputLine, lpright), new Line(b.currentLine, b.currentLineNumber), new Line(rp.currentInputLine, rpright)); + joinExprLines(new Line(num.getCurrentInputLine(), numright), new Line(lp.getCurrentInputLine(), lpright), new Line(b.currentLine, b.currentLineNumber), new Line(rp.getCurrentInputLine(), rpright)); int startCol = min(numleft, lpleft, b.startCol, rpleft); - int endCol = max(numleft + num.len, lpleft + lp.len, b.endCol, rpleft + rp.len); + int endCol = max(numleft + num.getLen(), lpleft + lp.getLen(), b.endCol, rpleft + rp.getLen()); RESULT = new NumericBoolNumericExpr(b, currentLinesSupplier, rpright, startCol, endCol); :} @@ -1477,9 +1477,9 @@ non_lambda_exprs ::= | LEN:len LPAR:lp expr:e RPAR:rp {: Supplier currentLinesSupplier = - joinExprLines(new Line(len.currentInputLine, lenright), new Line(lp.currentInputLine, lpright), new Line(e.currentLine, e.currentLineNumber), new Line(rp.currentInputLine, rpright)); + joinExprLines(new Line(len.getCurrentInputLine(), lenright), new Line(lp.getCurrentInputLine(), lpright), new Line(e.currentLine, e.currentLineNumber), new Line(rp.getCurrentInputLine(), rpright)); int startCol = min(lenleft, lpleft, e.startCol, rpleft); - int endCol = max(lenleft + len.len, lpleft + lp.len, e.endCol, rpleft + rp.len); + int endCol = max(lenleft + len.getLen(), lpleft + lp.getLen(), e.endCol, rpleft + rp.getLen()); RESULT = new LenExpr(e, currentLinesSupplier, rpright, startCol, endCol); :} @@ -1488,8 +1488,8 @@ non_lambda_exprs ::= | fmt_string:fs_symbol {: LexedValue> fsLexedValue = (LexedValue>) fs_symbol.value; - ImmutableList fs = fsLexedValue.val; - RESULT = new FormatStringExpr(fs.get(0).build().reverse(), fs.get(1).build().reverse(), fsLexedValue.currentInputLine, fs_symbol.right, fs_symbol.left, fs_symbol.left + fsLexedValue.len); + ImmutableList fs = fsLexedValue.getVal(); + RESULT = new FormatStringExpr(fs.get(0).build().reverse(), fs.get(1).build().reverse(), fsLexedValue.getCurrentInputLine(), fs_symbol.right, fs_symbol.left, fs_symbol.left + fsLexedValue.getLen()); :} | term:t {: RESULT = t; :} @@ -1515,11 +1515,11 @@ non_lambda_exprs ::= | CAST:cast LPAR:lp builtin_type:asserted_type COMMA:comma expr:casted_expr RPAR:rp {: Supplier currentLinesSupplier = - joinExprLines(new Line(lp.currentInputLine, lpright), new Line(((LexedValue)asserted_type.value).currentInputLine, asserted_type.right), new Line(rp.currentInputLine, rpright), new Line(casted_expr.currentLine, casted_expr.currentLineNumber)); + joinExprLines(new Line(lp.getCurrentInputLine(), lpright), new Line(((LexedValue)asserted_type.value).getCurrentInputLine(), asserted_type.right), new Line(rp.getCurrentInputLine(), rpright), new Line(casted_expr.currentLine, casted_expr.currentLineNumber)); int startCol = min(lpleft, asserted_type.left, rpleft, casted_expr.startCol); - int endCol = max(lpleft + lp.len, asserted_type.left + ((LexedValue)asserted_type.value).len, rpleft + rp.len, casted_expr.endCol); + int endCol = max(lpleft + lp.getLen(), asserted_type.left + ((LexedValue)asserted_type.value).getLen(), rpleft + rp.getLen(), casted_expr.endCol); - RESULT = new CastExpr(((LexedValue)asserted_type.value).val, casted_expr, currentLinesSupplier, casted_expr.currentLineNumber, startCol, endCol); + RESULT = new CastExpr(((LexedValue)asserted_type.value).getVal(), casted_expr, currentLinesSupplier, casted_expr.currentLineNumber, startCol, endCol); :} | get_http_client_expr:g {: RESULT = g; :} @@ -1552,9 +1552,9 @@ parenthesized_expr ::= LPAR:lp expr:e RPAR:rp {: Supplier currentLinesSupplier = - joinExprLines(new Line(lp.currentInputLine, lpright), new Line(e.currentLine, e.currentLineNumber), new Line(rp.currentInputLine, rpright)); + joinExprLines(new Line(lp.getCurrentInputLine(), lpright), new Line(e.currentLine, e.currentLineNumber), new Line(rp.getCurrentInputLine(), rpright)); int startCol = min(lpleft, e.startCol, rpleft); - int endCol = max(lpleft + lp.len, e.endCol, rpleft + rp.len); + int endCol = max(lpleft + lp.getLen(), e.endCol, rpleft + rp.getLen()); RESULT = new ParenthesizedExpr(e, currentLinesSupplier, rpright, startCol, endCol); :} @@ -1589,9 +1589,9 @@ copy_expr ::= COPY:copy LPAR:lp expr:e RPAR:rp {: Supplier currentLinesSupplier = - joinExprLines(new Line(copy.currentInputLine, copyright), new Line(lp.currentInputLine, lpright), new Line(e.currentLine, e.currentLineNumber), new Line(rp.currentInputLine, rpright)); + joinExprLines(new Line(copy.getCurrentInputLine(), copyright), new Line(lp.getCurrentInputLine(), lpright), new Line(e.currentLine, e.currentLineNumber), new Line(rp.getCurrentInputLine(), rpright)); int startCol = min(copyleft, lpleft, e.startCol, rpleft); - int endCol = max(copyleft + copy.len, lpleft + lp.len, e.endCol, rpleft + rp.len); + int endCol = max(copyleft + copy.getLen(), lpleft + lp.getLen(), e.endCol, rpleft + rp.getLen()); RESULT = new CopyExpr(e, currentLinesSupplier, rpright, startCol, endCol); :} @@ -1601,9 +1601,9 @@ from_json_expr ::= FROM_JSON:from_json LPAR:lp expr:e RPAR:rp {: Supplier currentLinesSupplier = - joinExprLines(new Line(from_json.currentInputLine, from_jsonright), new Line(lp.currentInputLine, lpright), new Line(e.currentLine, e.currentLineNumber), new Line(rp.currentInputLine, rpright)); + joinExprLines(new Line(from_json.getCurrentInputLine(), from_jsonright), new Line(lp.getCurrentInputLine(), lpright), new Line(e.currentLine, e.currentLineNumber), new Line(rp.getCurrentInputLine(), rpright)); int startCol = min(from_jsonleft, lpleft, e.startCol, rpleft); - int endCol = max(from_jsonleft + from_json.len, lpleft + lp.len, e.endCol, rpleft + rp.len); + int endCol = max(from_jsonleft + from_json.getLen(), lpleft + lp.getLen(), e.endCol, rpleft + rp.getLen()); RESULT = new FromJsonExpr(e, currentLinesSupplier, rpright, startCol, endCol); :} @@ -1614,38 +1614,38 @@ list ::= LBRACKET:lb args_list:args RBRACKET:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(((LexedValue) args.value).currentInputLine, args.right), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(((LexedValue) args.value).getCurrentInputLine(), args.right), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(lbleft, args.left, rbleft); - int endCol = max(lbleft + lb.len, args.left + ((LexedValue) args.value).len, rbleft + rb.len); + int endCol = max(lbleft + lb.getLen(), args.left + ((LexedValue) args.value).getLen(), rbleft + rb.getLen()); // Notice that we reverse the list before handing it to the ListExpr node because it was collected backwards. - RESULT = new ListExpr(((LexedValue>) args.value).val.build().reverse(), /*isMutable=*/false, currentLinesSupplier, rbright, startCol, endCol); + RESULT = new ListExpr(((LexedValue>) args.value).getVal().build().reverse(), /*isMutable=*/false, currentLinesSupplier, rbright, startCol, endCol); :} | LBRACKET:lb RBRACKET:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(lbleft, rbleft); - int endCol = max(lbleft + lb.len, rbleft + rb.len); + int endCol = max(lbleft + lb.getLen(), rbleft + rb.getLen()); RESULT = new ListExpr(/*isMutable=*/false, currentLinesSupplier, rbright, startCol, endCol); :} | MUT:mut LBRACKET:lb args_list:args RBRACKET:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(mut.currentInputLine, mutright), new Line(lb.currentInputLine, lbright), new Line(((LexedValue) args.value).currentInputLine, args.right), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(mut.getCurrentInputLine(), mutright), new Line(lb.getCurrentInputLine(), lbright), new Line(((LexedValue) args.value).getCurrentInputLine(), args.right), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(mutleft, lbleft, args.left, rbleft); - int endCol = max(mutleft + mut.len, lbleft + lb.len, args.left + ((LexedValue) args.value).len, rbleft + rb.len); + int endCol = max(mutleft + mut.getLen(), lbleft + lb.getLen(), args.left + ((LexedValue) args.value).getLen(), rbleft + rb.getLen()); // Notice that we reverse the list before handing it to the ListExpr node because it was collected backwards. - RESULT = new ListExpr(((LexedValue>) args.value).val.build().reverse(), /*isMutable=*/true, currentLinesSupplier, rbright, startCol, endCol); + RESULT = new ListExpr(((LexedValue>) args.value).getVal().build().reverse(), /*isMutable=*/true, currentLinesSupplier, rbright, startCol, endCol); :} | MUT:mut LBRACKET:lb RBRACKET:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(mut.currentInputLine, mutright), new Line(lb.currentInputLine, lbright), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(mut.getCurrentInputLine(), mutright), new Line(lb.getCurrentInputLine(), lbright), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(mutleft, lbleft, rbleft); - int endCol = max(mutleft + mut.len, lbleft + lb.len, rbleft + rb.len); + int endCol = max(mutleft + mut.getLen(), lbleft + lb.getLen(), rbleft + rb.getLen()); RESULT = new ListExpr(/*isMutable=*/true, currentLinesSupplier, rbright, startCol, endCol); :} @@ -1654,19 +1654,19 @@ list ::= map ::= LCURLY:lc RCURLY:rc {: - RESULT = new MapExpr(ImmutableList.of(), /*isMutable=*/false, joinExprLines(new Line(lc.currentInputLine, lcright), new Line(rc.currentInputLine, rcright)), rcright, min(lcleft, rcleft), max(lcleft + lc.len, rcleft + rc.len)); + RESULT = new MapExpr(ImmutableList.of(), /*isMutable=*/false, joinExprLines(new Line(lc.getCurrentInputLine(), lcright), new Line(rc.getCurrentInputLine(), rcright)), rcright, min(lcleft, rcleft), max(lcleft + lc.getLen(), rcleft + rc.getLen())); :} | LCURLY:lc map_initializer_kv_list:initializer RCURLY:rc {: - RESULT = new MapExpr(initializer.build().reverse(), /*isMutable=*/false, joinExprLines(new Line(lc.currentInputLine, lcright), new Line(rc.currentInputLine, rcright)), rcright, min(lcleft, rcleft), max(lcleft + lc.len, rcleft + rc.len)); + RESULT = new MapExpr(initializer.build().reverse(), /*isMutable=*/false, joinExprLines(new Line(lc.getCurrentInputLine(), lcright), new Line(rc.getCurrentInputLine(), rcright)), rcright, min(lcleft, rcleft), max(lcleft + lc.getLen(), rcleft + rc.getLen())); :} | MUT:mut LCURLY:lc RCURLY:rc {: - RESULT = new MapExpr(ImmutableList.of(), /*isMutable=*/true, joinExprLines(new Line(mut.currentInputLine, mutright), new Line(lc.currentInputLine, lcright), new Line(rc.currentInputLine, rcright)), rcright, min(mutleft, lcleft, rcleft), max(mutleft + mut.len, lcleft + lc.len, rcleft + rc.len)); + RESULT = new MapExpr(ImmutableList.of(), /*isMutable=*/true, joinExprLines(new Line(mut.getCurrentInputLine(), mutright), new Line(lc.getCurrentInputLine(), lcright), new Line(rc.getCurrentInputLine(), rcright)), rcright, min(mutleft, lcleft, rcleft), max(mutleft + mut.getLen(), lcleft + lc.getLen(), rcleft + rc.getLen())); :} | MUT:mut LCURLY:lc map_initializer_kv_list:initializer RCURLY:rc {: - RESULT = new MapExpr(initializer.build().reverse(), /*isMutable=*/true, joinExprLines(new Line(mut.currentInputLine, mutright), new Line(lc.currentInputLine, lcright), new Line(rc.currentInputLine, rcright)), rcright, min(mutleft, lcleft, rcleft), max(mutleft + mut.len, lcleft + lc.len, rcleft + rc.len)); + RESULT = new MapExpr(initializer.build().reverse(), /*isMutable=*/true, joinExprLines(new Line(mut.getCurrentInputLine(), mutright), new Line(lc.getCurrentInputLine(), lcright), new Line(rc.getCurrentInputLine(), rcright)), rcright, min(mutleft, lcleft, rcleft), max(mutleft + mut.getLen(), lcleft + lc.getLen(), rcleft + rc.getLen())); :} ; @@ -1709,9 +1709,9 @@ args_list ::= expr:head COMMA:c args_list:tail {: Supplier currentLinesSupplier = - joinExprLines(new Line(head.currentLine, head.currentLineNumber), new Line(c.currentInputLine, cright), new Line(((LexedValue)tail.value).currentInputLine, tail.right)); + joinExprLines(new Line(head.currentLine, head.currentLineNumber), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue)tail.value).getCurrentInputLine(), tail.right)); int startCol = min(head.startCol, cleft, tail.left); - int endCol = max(head.endCol, cleft + c.len, tail.left + ((LexedValue) tail.value).len); + int endCol = max(head.endCol, cleft + c.getLen(), tail.left + ((LexedValue) tail.value).getLen()); // Notice that we're building this list in reverse order, just by the order of the parser recursively identifying // each expr in the list. @@ -1719,8 +1719,8 @@ args_list ::= -1, startCol, tail.right, // line number - new LexedValue( - ((LexedValue>) tail.value).val.add(head), + LexedValue.create( + ((LexedValue>) tail.value).getVal().add(head), currentLinesSupplier, endCol - startCol) ); @@ -1731,7 +1731,7 @@ args_list ::= -1, e.startCol, e.currentLineNumber, // line number - new LexedValue( + LexedValue.create( ImmutableList.builder().add(e), e.currentLine, e.endCol - e.startCol) @@ -1743,22 +1743,22 @@ struct ::= LCURLY:lc struct_field_initializers_list:fields RCURLY:rc {: Supplier currentLinesSupplier = - joinExprLines(new Line(lc.currentInputLine, lcright), new Line(((LexedValue) fields.value).currentInputLine, fields.right), new Line(rc.currentInputLine, rcright)); + joinExprLines(new Line(lc.getCurrentInputLine(), lcright), new Line(((LexedValue) fields.value).getCurrentInputLine(), fields.right), new Line(rc.getCurrentInputLine(), rcright)); int startCol = min(lcleft, fields.left, rcleft); - int endCol = max(lcleft + lc.len, fields.left + ((LexedValue) fields.value).len, rcleft + rc.len); + int endCol = max(lcleft + lc.getLen(), fields.left + ((LexedValue) fields.value).getLen(), rcleft + rc.getLen()); - ImmutableMap fieldsMap = ((LexedValue>) fields.value).val.build(); + ImmutableMap fieldsMap = ((LexedValue>) fields.value).getVal().build(); RESULT = new StructExpr(fieldsMap.keySet().asList().reverse(), fieldsMap.values().asList().reverse(), /*isMutable=*/false, currentLinesSupplier, rcright, startCol, endCol); :} | MUT:mut LCURLY:lc struct_field_initializers_list:fields RCURLY:rc {: Supplier currentLinesSupplier = - joinExprLines(new Line(mut.currentInputLine, mutright), new Line(lc.currentInputLine, lcright), new Line(((LexedValue) fields.value).currentInputLine, fields.right), new Line(rc.currentInputLine, rcright)); + joinExprLines(new Line(mut.getCurrentInputLine(), mutright), new Line(lc.getCurrentInputLine(), lcright), new Line(((LexedValue) fields.value).getCurrentInputLine(), fields.right), new Line(rc.getCurrentInputLine(), rcright)); int startCol = min(mutleft, lcleft, fields.left, rcleft); - int endCol = max(mutleft + mut.len, lcleft + lc.len, fields.left + ((LexedValue) fields.value).len, rcleft + rc.len); + int endCol = max(mutleft + mut.getLen(), lcleft + lc.getLen(), fields.left + ((LexedValue) fields.value).getLen(), rcleft + rc.getLen()); - ImmutableMap fieldsMap = ((LexedValue>) fields.value).val.build(); + ImmutableMap fieldsMap = ((LexedValue>) fields.value).getVal().build(); RESULT = new StructExpr(fieldsMap.keySet().asList().reverse(), fieldsMap.values().asList().reverse(), /*isMutable=*/true, currentLinesSupplier, rcright, startCol, endCol); :} @@ -1769,16 +1769,16 @@ struct_field_initializers_list ::= IDENTIFIER:arg_name ASSIGNMENT:eq expr:e COMMA:comma struct_field_initializers_list:tail {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentInputLine, arg_nameright), new Line(eq.currentInputLine, eqright), new Line(e.currentLine, e.currentLineNumber), new Line(comma.currentInputLine, commaright), new Line(((LexedValue) tail.value).currentInputLine, tail.right)); + joinExprLines(new Line(arg_name.getCurrentInputLine(), arg_nameright), new Line(eq.getCurrentInputLine(), eqright), new Line(e.currentLine, e.currentLineNumber), new Line(comma.getCurrentInputLine(), commaright), new Line(((LexedValue) tail.value).getCurrentInputLine(), tail.right)); int startCol = min(arg_nameleft, eqleft, e.startCol, commaleft, tail.left); - int endCol = max(arg_nameleft + arg_name.len, eqleft + eq.len, e.endCol, commaleft + comma.len, tail.left + ((LexedValue) tail.value).len); + int endCol = max(arg_nameleft + arg_name.getLen(), eqleft + eq.getLen(), e.endCol, commaleft + comma.getLen(), tail.left + ((LexedValue) tail.value).getLen()); RESULT = new Symbol( -1, startCol, tail.right, // line number - new LexedValue( - ((LexedValue>) tail.value).val.put(arg_name.val, e), + LexedValue.create( + ((LexedValue>) tail.value).getVal().put(arg_name.getVal(), e), currentLinesSupplier, endCol - startCol) ); @@ -1786,16 +1786,16 @@ struct_field_initializers_list ::= | IDENTIFIER:arg_name ASSIGNMENT:eq expr:e {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentInputLine, arg_nameright), new Line(eq.currentInputLine, eqright), new Line(e.currentLine, e.currentLineNumber)); + joinExprLines(new Line(arg_name.getCurrentInputLine(), arg_nameright), new Line(eq.getCurrentInputLine(), eqright), new Line(e.currentLine, e.currentLineNumber)); int startCol = min(arg_nameleft, eqleft, e.startCol); - int endCol = max(arg_nameleft + arg_name.len, eqleft + eq.len, e.endCol); + int endCol = max(arg_nameleft + arg_name.getLen(), eqleft + eq.getLen(), e.endCol); RESULT = new Symbol( -1, startCol, e.currentLineNumber, // line number - new LexedValue( - ImmutableMap.builder().put(arg_name.val, e), + LexedValue.create( + ImmutableMap.builder().put(arg_name.getVal(), e), currentLinesSupplier, endCol - startCol) ); @@ -1806,11 +1806,11 @@ struct_field_access_expr ::= expr:e DOT:dot IDENTIFIER:id {: Supplier currentLinesSupplier = - joinExprLines(new Line(e.currentLine, e.currentLineNumber), new Line(dot.currentInputLine, dotright), new Line(id.currentInputLine, idright)); + joinExprLines(new Line(e.currentLine, e.currentLineNumber), new Line(dot.getCurrentInputLine(), dotright), new Line(id.getCurrentInputLine(), idright)); int startCol = min(e.startCol, dotleft, idleft); - int endCol = max(e.endCol, dotleft + dot.len, idleft + id.len); + int endCol = max(e.endCol, dotleft + dot.getLen(), idleft + id.getLen()); - RESULT = new StructFieldAccessExpr(e, id.val, currentLinesSupplier, idright, startCol, endCol); + RESULT = new StructFieldAccessExpr(e, id.getVal(), currentLinesSupplier, idright, startCol, endCol); :} ; @@ -1921,7 +1921,7 @@ match_case_patterns ::= {: RESULT = MatchStmt.MaybeWildcardPrimitivePattern.forNullableExpr(p); :} | MINUS INTEGER:i {: RESULT = MatchStmt.MaybeWildcardPrimitivePattern.forNullableExpr( - new IntegerTerm(-(i.val), i.currentInputLine, iright, ileft, ileft + i.len)); :} + new IntegerTerm(-(i.getVal()), i.getCurrentInputLine(), iright, ileft, ileft + i.getLen())); :} | identifier:wildcard {: RESULT = MatchStmt.MaybeWildcardPrimitivePattern.forWildcardBinding(wildcard); :} | identifier:type LPAR primitive:wrapped RPAR @@ -1945,9 +1945,9 @@ match_case_patterns ::= | MUT:mut LCURLY:lc match_case_pattern_struct_field_list:fields RCURLY:rc {: RESULT = MatchStmt.StructPattern.forFieldPatterns(fields.build().reverse(), /*isMutable=*/true); :} | UNDERSCORE COLON builtin_type:t - {: RESULT = MatchStmt.MaybeWildcardPrimitivePattern.forNullableExpr(((LexedValue) t.value).val); :} + {: RESULT = MatchStmt.MaybeWildcardPrimitivePattern.forNullableExpr(((LexedValue) t.value).getVal()); :} | identifier:binding COLON builtin_type:t - {: RESULT = MatchStmt.MaybeWildcardPrimitivePattern.forTypeLiteralWildcardBinding(((LexedValue) t.value).val, binding); :} + {: RESULT = MatchStmt.MaybeWildcardPrimitivePattern.forTypeLiteralWildcardBinding(((LexedValue) t.value).getVal(), binding); :} | UNDERSCORE // TODO(steving) This should model `_` as an Expr to have something to point at in errors. {: RESULT = MatchStmt.MaybeWildcardPrimitivePattern.forNullableExpr(null); :} @@ -2016,48 +2016,48 @@ repeat_stmt ::= break_stmt ::= BREAK:b SEMICOLON - {: RESULT = new BreakStmt(b.currentInputLine, bright, bleft, bleft + b.len); :} + {: RESULT = new BreakStmt(b.getCurrentInputLine(), bright, bleft, bleft + b.getLen()); :} ; continue_stmt ::= CONTINUE:c SEMICOLON - {: RESULT = new ContinueStmt(c.currentInputLine, cright, cleft, cleft + c.len); :} + {: RESULT = new ContinueStmt(c.getCurrentInputLine(), cright, cleft, cleft + c.getLen()); :} ; list_comprehension_expr ::= LBRACKET:lb expr:mapped_item_expr BAR:bar identifier:item_name IN:in expr:collection_expr RBRACKET:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(lbleft, mapped_item_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, rbleft); - int endCol = max(lbleft + lb.len, mapped_item_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, rbleft + rb.len); + int endCol = max(lbleft + lb.getLen(), mapped_item_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.LIST, mapped_item_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.empty(), /*isMutable=*/false, currentLinesSupplier, rbright, startCol, endCol); :} | MUT:mut LBRACKET:lb expr:mapped_item_expr BAR:bar identifier:item_name IN:in expr:collection_expr RBRACKET:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(mut.currentInputLine, mutright), new Line(lb.currentInputLine, lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(mut.getCurrentInputLine(), mutright), new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(mutleft, lbleft, mapped_item_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, rbleft); - int endCol = max(mutleft + mut.len, lbleft + lb.len, mapped_item_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, rbleft + rb.len); + int endCol = max(mutleft + mut.getLen(), lbleft + lb.getLen(), mapped_item_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.LIST, mapped_item_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.empty(), /*isMutable=*/true, currentLinesSupplier, rbright, startCol, endCol); :} | LBRACKET:lb expr:mapped_item_expr BAR:bar identifier:item_name IN:in expr:collection_expr WHERE:where expr:filter_expr RBRACKET:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.currentInputLine, whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.getCurrentInputLine(), whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(lbleft, mapped_item_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, whereleft, filter_expr.startCol, rbleft); - int endCol = max(lbleft + lb.len, mapped_item_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, whereleft + where.len, filter_expr.endCol, rbleft + rb.len); + int endCol = max(lbleft + lb.getLen(), mapped_item_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, whereleft + where.getLen(), filter_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.LIST, mapped_item_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.of(filter_expr), /*isMutable=*/false, currentLinesSupplier, rbright, startCol, endCol); :} | MUT:mut LBRACKET:lb expr:mapped_item_expr BAR:bar identifier:item_name IN:in expr:collection_expr WHERE:where expr:filter_expr RBRACKET:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.currentInputLine, whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.getCurrentInputLine(), whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(mutleft, lbleft, mapped_item_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, whereleft, filter_expr.startCol, rbleft); - int endCol = max(mutleft + mut.len, lbleft + lb.len, mapped_item_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, whereleft + where.len, filter_expr.endCol, rbleft + rb.len); + int endCol = max(mutleft + mut.getLen(), lbleft + lb.getLen(), mapped_item_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, whereleft + where.getLen(), filter_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.LIST, mapped_item_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.of(filter_expr), /*isMutable=*/true, currentLinesSupplier, rbright, startCol, endCol); :} @@ -2067,36 +2067,36 @@ set_comprehension_expr ::= LCURLY:lb expr:mapped_item_expr BAR:bar identifier:item_name IN:in expr:collection_expr RCURLY:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(lbleft, mapped_item_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, rbleft); - int endCol = max(lbleft + lb.len, mapped_item_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, rbleft + rb.len); + int endCol = max(lbleft + lb.getLen(), mapped_item_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.SET, mapped_item_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.empty(), /*isMutable=*/false, currentLinesSupplier, rbright, startCol, endCol); :} | MUT:mut LCURLY:lb expr:mapped_item_expr BAR:bar identifier:item_name IN:in expr:collection_expr RCURLY:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(mut.currentInputLine, mutright), new Line(lb.currentInputLine, lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(mut.getCurrentInputLine(), mutright), new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(mutleft, lbleft, mapped_item_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, rbleft); - int endCol = max(mutleft + mut.len, lbleft + lb.len, mapped_item_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, rbleft + rb.len); + int endCol = max(mutleft + mut.getLen(), lbleft + lb.getLen(), mapped_item_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.SET, mapped_item_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.empty(), /*isMutable=*/true, currentLinesSupplier, rbright, startCol, endCol); :} | LCURLY:lb expr:mapped_item_expr BAR:bar identifier:item_name IN:in expr:collection_expr WHERE:where expr:filter_expr RCURLY:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.currentInputLine, whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.getCurrentInputLine(), whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(lbleft, mapped_item_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, whereleft, filter_expr.startCol, rbleft); - int endCol = max(lbleft + lb.len, mapped_item_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, whereleft + where.len, filter_expr.endCol, rbleft + rb.len); + int endCol = max(lbleft + lb.getLen(), mapped_item_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, whereleft + where.getLen(), filter_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.SET, mapped_item_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.of(filter_expr), /*isMutable=*/false, currentLinesSupplier, rbright, startCol, endCol); :} | MUT:mut LCURLY:lb expr:mapped_item_expr BAR:bar identifier:item_name IN:in expr:collection_expr WHERE:where expr:filter_expr RCURLY:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.currentInputLine, whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_item_expr.currentLine, mapped_item_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.getCurrentInputLine(), whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(mutleft, lbleft, mapped_item_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, whereleft, filter_expr.startCol, rbleft); - int endCol = max(mutleft + mut.len, lbleft + lb.len, mapped_item_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, whereleft + where.len, filter_expr.endCol, rbleft + rb.len); + int endCol = max(mutleft + mut.getLen(), lbleft + lb.getLen(), mapped_item_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, whereleft + where.getLen(), filter_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.SET, mapped_item_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.of(filter_expr), /*isMutable=*/true, currentLinesSupplier, rbright, startCol, endCol); :} @@ -2106,36 +2106,36 @@ map_comprehension_expr ::= LCURLY:lb expr:mapped_key_expr COLON:c expr:mapped_value_expr BAR:bar identifier:item_name IN:in expr:collection_expr RCURLY:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(mapped_key_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(c.currentInputLine, cright), new Line(mapped_value_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_key_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(c.getCurrentInputLine(), cright), new Line(mapped_value_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(lbleft, mapped_key_expr.startCol, cleft, mapped_value_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, rbleft); - int endCol = max(lbleft + lb.len, mapped_key_expr.endCol, cleft + c.len, mapped_value_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, rbleft + rb.len); + int endCol = max(lbleft + lb.getLen(), mapped_key_expr.endCol, cleft + c.getLen(), mapped_value_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.MAP, mapped_key_expr, mapped_value_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.empty(), /*isMutable=*/false, currentLinesSupplier, rbright, startCol, endCol); :} | MUT:mut LCURLY:lb expr:mapped_key_expr COLON:c expr:mapped_value_expr BAR:bar identifier:item_name IN:in expr:collection_expr RCURLY:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(mut.currentInputLine, mutright), new Line(lb.currentInputLine, lbright), new Line(mapped_key_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(c.currentInputLine, cright), new Line(mapped_value_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(mut.getCurrentInputLine(), mutright), new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_key_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(c.getCurrentInputLine(), cright), new Line(mapped_value_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(mutleft, lbleft, mapped_key_expr.startCol, cleft, mapped_value_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, rbleft); - int endCol = max(mutleft + mut.len, lbleft + lb.len, mapped_key_expr.endCol, cleft + c.len, mapped_value_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, rbleft + rb.len); + int endCol = max(mutleft + mut.getLen(), lbleft + lb.getLen(), mapped_key_expr.endCol, cleft + c.getLen(), mapped_value_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.MAP, mapped_key_expr, mapped_value_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.empty(), /*isMutable=*/true, currentLinesSupplier, rbright, startCol, endCol); :} | LCURLY:lb expr:mapped_key_expr COLON:c expr:mapped_value_expr BAR:bar identifier:item_name IN:in expr:collection_expr WHERE:where expr:filter_expr RCURLY:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(mapped_key_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(c.currentInputLine, cright), new Line(mapped_value_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.currentInputLine, whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_key_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(c.getCurrentInputLine(), cright), new Line(mapped_value_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.getCurrentInputLine(), whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(lbleft, mapped_key_expr.startCol, cleft, mapped_value_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, whereleft, filter_expr.startCol, rbleft); - int endCol = max(lbleft + lb.len, mapped_key_expr.endCol, cleft + c.len, mapped_value_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, whereleft + where.len, filter_expr.endCol, rbleft + rb.len); + int endCol = max(lbleft + lb.getLen(), mapped_key_expr.endCol, cleft + c.getLen(), mapped_value_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, whereleft + where.getLen(), filter_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.MAP, mapped_key_expr, mapped_value_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.of(filter_expr), /*isMutable=*/false, currentLinesSupplier, rbright, startCol, endCol); :} | MUT:mut LCURLY:lb expr:mapped_key_expr COLON:c expr:mapped_value_expr BAR:bar identifier:item_name IN:in expr:collection_expr WHERE:where expr:filter_expr RCURLY:rb {: Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(mapped_key_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(c.currentInputLine, cright), new Line(mapped_value_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(bar.currentInputLine, barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.currentInputLine, whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(mapped_key_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(c.getCurrentInputLine(), cright), new Line(mapped_value_expr.currentLine, mapped_value_expr.currentLineNumber), new Line(bar.getCurrentInputLine(), barright), new Line(item_name.currentLine, item_name.currentLineNumber), new Line(collection_expr.currentLine, collection_expr.currentLineNumber), new Line(where.getCurrentInputLine(), whereright), new Line(filter_expr.currentLine, filter_expr.currentLineNumber), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(mutleft, lbleft, mapped_key_expr.startCol, cleft, mapped_value_expr.startCol, barleft, item_name.startCol, inleft, collection_expr.startCol, whereleft, filter_expr.startCol, rbleft); - int endCol = max(mutleft + mut.len, lbleft + lb.len, mapped_key_expr.endCol, cleft + c.len, mapped_value_expr.endCol, barleft + bar.len, item_name.endCol, inleft + in.len, collection_expr.endCol, whereleft + where.len, filter_expr.endCol, rbleft + rb.len); + int endCol = max(mutleft + mut.getLen(), lbleft + lb.getLen(), mapped_key_expr.endCol, cleft + c.getLen(), mapped_value_expr.endCol, barleft + bar.getLen(), item_name.endCol, inleft + in.getLen(), collection_expr.endCol, whereleft + where.getLen(), filter_expr.endCol, rbleft + rb.getLen()); RESULT = new ComprehensionExpr(BaseType.MAP, mapped_key_expr, mapped_value_expr, item_name, collection_expr, /*whereClauseExpr=*/Optional.of(filter_expr), /*isMutable=*/true, currentLinesSupplier, rbright, startCol, endCol); :} @@ -2145,77 +2145,77 @@ function_definition_stmt ::= FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new FunctionDefinitionStmt(name.val, argTypesMap, outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); + RESULT = new FunctionDefinitionStmt(name.getVal(), argTypesMap, outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); :} | USING LPAR injected_keys_list:bw_injected_keys RPAR FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); - RESULT = new FunctionDefinitionStmt(name.val, argTypesMap, Optional.of(injectedKeysList), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); + RESULT = new FunctionDefinitionStmt(name.getVal(), argTypesMap, Optional.of(injectedKeysList), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); :} | BLOCKING FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new FunctionDefinitionStmt(name.val, argTypesMap, outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); + RESULT = new FunctionDefinitionStmt(name.getVal(), argTypesMap, outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); :} | USING LPAR injected_keys_list:bw_injected_keys RPAR BLOCKING FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); - RESULT = new FunctionDefinitionStmt(name.val, argTypesMap, Optional.of(injectedKeysList), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); + RESULT = new FunctionDefinitionStmt(name.getVal(), argTypesMap, Optional.of(injectedKeysList), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); :} | generic_blocking_on:generic_blocking_on FUNCTION_TYPE IDENTIFIER:name LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new FunctionDefinitionStmt(name.val, argTypesMap, outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); + RESULT = new FunctionDefinitionStmt(name.getVal(), argTypesMap, outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); :} | USING LPAR injected_keys_list:bw_injected_keys RPAR generic_blocking_on:generic_blocking_on FUNCTION_TYPE IDENTIFIER:name LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); - RESULT = new FunctionDefinitionStmt(name.val, argTypesMap, Optional.of(injectedKeysList), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); + RESULT = new FunctionDefinitionStmt(name.getVal(), argTypesMap, Optional.of(injectedKeysList), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); :} ; @@ -2223,69 +2223,69 @@ generic_function_definition_stmt ::= FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new GenericFunctionDefinitionStmt(name.val, /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new GenericFunctionDefinitionStmt(name.getVal(), /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); :} | REQUIRES LPAR required_contracts:required_contracts RPAR FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); + ((LexedValue>)generic_types.value).getVal().build().reverse(); RESULT = new GenericFunctionDefinitionStmt( - name.val, (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); + name.getVal(), (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); :} | BLOCKING FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new GenericFunctionDefinitionStmt(name.val, /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new GenericFunctionDefinitionStmt(name.getVal(), /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); :} | REQUIRES LPAR required_contracts:required_contracts RPAR BLOCKING FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); + ((LexedValue>)generic_types.value).getVal().build().reverse(); RESULT = new GenericFunctionDefinitionStmt( - name.val, (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); + name.getVal(), (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); :} | generic_blocking_on:generic_blocking_on FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. @@ -2294,14 +2294,14 @@ generic_function_definition_stmt ::= ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); + ((LexedValue>)generic_types.value).getVal().build().reverse(); RESULT = new GenericFunctionDefinitionStmt( - name.val, /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); + name.getVal(), /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); :} | REQUIRES LPAR required_contracts:required_contracts RPAR generic_blocking_on:generic_blocking_on FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; // This production matched a function defined by a list of statements followed by a return Expr to eval. @@ -2310,9 +2310,9 @@ generic_function_definition_stmt ::= ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); + ((LexedValue>)generic_types.value).getVal().build().reverse(); RESULT = new GenericFunctionDefinitionStmt( - name.val, (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); + name.getVal(), (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); :} ; @@ -2326,11 +2326,11 @@ generic_blocking_on ::= identifier_bar_sep_list ::= IDENTIFIER:i BAR identifier_bar_sep_list:b {: - RESULT = b.add(i.val); + RESULT = b.add(i.getVal()); :} | IDENTIFIER:i {: - RESULT = ImmutableList.builder().add(i.val); + RESULT = ImmutableList.builder().add(i.getVal()); :} ; @@ -2340,26 +2340,26 @@ maybe_blocking_procedure_types ::= LexedValue argLexedVal = (LexedValue) arg.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; - RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.val.resolveType(scopedHeap)), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); + RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.getVal().resolveType(scopedHeap)), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); :} | MAYBE_BLOCKING FUNCTION_TYPE:t L_ANGLE_BRACKET:la BAR:b1 builtin_types_list:arg_types BAR:b2 ARROW:a builtin_type:output_type R_ANGLE_BRACKET:ra {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; - RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); + RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); :} | MAYBE_BLOCKING CONSUMER_FUNCTION_TYPE:t L_ANGLE_BRACKET:la builtin_types_list:arg_types R_ANGLE_BRACKET:ra {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; - RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/null); + RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/null); :} | MAYBE_BLOCKING PROVIDER_FUNCTION_TYPE:p L_ANGLE_BRACKET:la builtin_type:output_type R_ANGLE_BRACKET:ra {: LexedValue outputTypeLexedVal = (LexedValue) output_type.value; - RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); + RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); :} ; @@ -2369,16 +2369,16 @@ required_contracts ::= IDENTIFIER:contract_name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET COMMA required_contracts:tail {: ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse().stream() + ((LexedValue>)generic_types.value).getVal().build().reverse().stream() .map(g -> Types.$GenericTypeParam.forTypeParamName(g)).collect(ImmutableList.toImmutableList()); - RESULT = tail.put(contract_name.val, genericTypesList); + RESULT = tail.put(contract_name.getVal(), genericTypesList); :} | IDENTIFIER:contract_name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET {: ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse().stream() + ((LexedValue>)generic_types.value).getVal().build().reverse().stream() .map(g -> Types.$GenericTypeParam.forTypeParamName(g)).collect(ImmutableList.toImmutableList()); - RESULT = ImmutableListMultimap.>builder().put(contract_name.val, genericTypesList); + RESULT = ImmutableListMultimap.>builder().put(contract_name.getVal(), genericTypesList); :} ; @@ -2386,53 +2386,53 @@ lambda_function_expr ::= IDENTIFIER:arg_name ARROW:a expr:implicit_return_expr {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentInputLine, arg_nameright), new Line(a.currentInputLine, aright), new Line(implicit_return_expr.currentLine, implicit_return_expr.currentLineNumber)); + joinExprLines(new Line(arg_name.getCurrentInputLine(), arg_nameright), new Line(a.getCurrentInputLine(), aright), new Line(implicit_return_expr.currentLine, implicit_return_expr.currentLineNumber)); int startCol = min(arg_nameleft, aleft, implicit_return_exprleft); - int endCol = max(arg_nameleft + arg_name.len, aleft + a.len, implicit_return_expr.endCol); + int endCol = max(arg_nameleft + arg_name.getLen(), aleft + a.getLen(), implicit_return_expr.endCol); // In this case, we can generate our own settable reference to a TypeProvider for the ReturnStmt. AtomicReference returnTypeReference = new AtomicReference<>(null); ReturnStmt implicitReturnStmt = new ReturnStmt(implicit_return_expr, returnTypeReference); - RESULT = new LambdaExpr(ImmutableList.of(arg_name.val), new StmtListNode(implicitReturnStmt), returnTypeReference, currentLinesSupplier, implicit_return_expr.currentLineNumber, startCol, endCol); + RESULT = new LambdaExpr(ImmutableList.of(arg_name.getVal()), new StmtListNode(implicitReturnStmt), returnTypeReference, currentLinesSupplier, implicit_return_expr.currentLineNumber, startCol, endCol); :} | IDENTIFIER:arg_name ARROW:a LCURLY:lc stmt_list:stmt_list RCURLY:rc {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentInputLine, arg_nameright), new Line(a.currentInputLine, aright), new Line(lc.currentInputLine, lcright), new Line(() -> "...", lcright + 2 > rcright ? lcright : lcright + 1), new Line(rc.currentInputLine, rcright)); + joinExprLines(new Line(arg_name.getCurrentInputLine(), arg_nameright), new Line(a.getCurrentInputLine(), aright), new Line(lc.getCurrentInputLine(), lcright), new Line(() -> "...", lcright + 2 > rcright ? lcright : lcright + 1), new Line(rc.getCurrentInputLine(), rcright)); int startCol = min(arg_nameleft, aleft, lcleft, rcleft); - int endCol = max(arg_nameleft + arg_name.len, aleft + a.len, lcleft + lc.len, rcleft + rc.len); + int endCol = max(arg_nameleft + arg_name.getLen(), aleft + a.getLen(), lcleft + lc.getLen(), rcleft + rc.getLen()); // In this case we can pass on the TypeProvider reference that any ReturnStmts have been using. - RESULT = new LambdaExpr(ImmutableList.of(arg_name.val), stmt_list, returnTypeHolder, currentLinesSupplier, rcright, startCol, endCol); + RESULT = new LambdaExpr(ImmutableList.of(arg_name.getVal()), stmt_list, returnTypeHolder, currentLinesSupplier, rcright, startCol, endCol); :} | LAMBDA:lam LPAR:lp IDENTIFIER:first_arg_name COMMA:c identifier_list:arg_names RPAR:rp ARROW:a expr:implicit_return_expr {: Supplier currentLinesSupplier = - joinExprLines(new Line(lam.currentInputLine, lamright), new Line(lp.currentInputLine, lpright), new Line(first_arg_name.currentInputLine, first_arg_nameright), new Line(c.currentInputLine, cright), new Line(((LexedValue) arg_names.value).currentInputLine, arg_namesright), new Line(rp.currentInputLine, rpright), new Line(a.currentInputLine, aright), new Line(implicit_return_expr.currentLine, implicit_return_expr.currentLineNumber)); + joinExprLines(new Line(lam.getCurrentInputLine(), lamright), new Line(lp.getCurrentInputLine(), lpright), new Line(first_arg_name.getCurrentInputLine(), first_arg_nameright), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue) arg_names.value).getCurrentInputLine(), arg_namesright), new Line(rp.getCurrentInputLine(), rpright), new Line(a.getCurrentInputLine(), aright), new Line(implicit_return_expr.currentLine, implicit_return_expr.currentLineNumber)); int startCol = min(lamleft, lpleft, first_arg_nameleft, cleft, arg_names.left, rpleft, aleft, implicit_return_exprleft); - int endCol = max(lamleft + lam.len, lpleft + lp.len, first_arg_nameleft + first_arg_name.len, cleft + c.len, arg_names.left + ((LexedValue)arg_names.value).len, rpleft + rp.len, aleft + a.len, implicit_return_expr.endCol); + int endCol = max(lamleft + lam.getLen(), lpleft + lp.getLen(), first_arg_nameleft + first_arg_name.getLen(), cleft + c.getLen(), arg_names.left + ((LexedValue)arg_names.value).getLen(), rpleft + rp.getLen(), aleft + a.getLen(), implicit_return_expr.endCol); // In this case, we can generate our own settable reference to a TypeProvider for the ReturnStmt. AtomicReference returnTypeReference = new AtomicReference<>(null); ReturnStmt implicitReturnStmt = new ReturnStmt(implicit_return_expr, returnTypeReference); - RESULT = new LambdaExpr(((LexedValue>)arg_names.value).val.add(first_arg_name.val).build().reverse(), new StmtListNode(implicitReturnStmt), returnTypeReference, currentLinesSupplier, implicit_return_exprright, startCol, endCol); + RESULT = new LambdaExpr(((LexedValue>)arg_names.value).getVal().add(first_arg_name.getVal()).build().reverse(), new StmtListNode(implicitReturnStmt), returnTypeReference, currentLinesSupplier, implicit_return_exprright, startCol, endCol); :} | LAMBDA:lam LPAR:lp IDENTIFIER:first_arg_name COMMA:c identifier_list:arg_names RPAR:rp ARROW:a LCURLY:lc stmt_list:stmt_list RCURLY:rc {: Supplier currentLinesSupplier = - joinExprLines(new Line(lam.currentInputLine, lamright), new Line(lp.currentInputLine, lpright), new Line(first_arg_name.currentInputLine, first_arg_nameright), new Line(c.currentInputLine, cright), new Line(((LexedValue)arg_names.value).currentInputLine, arg_namesright), new Line(rp.currentInputLine, rpright), new Line(a.currentInputLine, aright), new Line(lc.currentInputLine, lcright), new Line(() -> "...", lcright + 2 > rcright ? lcright : lcright + 1), new Line(rc.currentInputLine, rcright)); + joinExprLines(new Line(lam.getCurrentInputLine(), lamright), new Line(lp.getCurrentInputLine(), lpright), new Line(first_arg_name.getCurrentInputLine(), first_arg_nameright), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue)arg_names.value).getCurrentInputLine(), arg_namesright), new Line(rp.getCurrentInputLine(), rpright), new Line(a.getCurrentInputLine(), aright), new Line(lc.getCurrentInputLine(), lcright), new Line(() -> "...", lcright + 2 > rcright ? lcright : lcright + 1), new Line(rc.getCurrentInputLine(), rcright)); int startCol = min(lamleft, lpleft, first_arg_nameleft, cleft, arg_names.left, rpleft, aleft, lcleft, rcleft); - int endCol = max(lamleft + lam.len, lpleft + lp.len, first_arg_nameleft + first_arg_name.len, cleft + c.len, arg_names.left + ((LexedValue)arg_names.value).len, rpleft + rp.len, aleft + a.len, lcleft + lc.len, rcleft + rc.len); + int endCol = max(lamleft + lam.getLen(), lpleft + lp.getLen(), first_arg_nameleft + first_arg_name.getLen(), cleft + c.getLen(), arg_names.left + ((LexedValue)arg_names.value).getLen(), rpleft + rp.getLen(), aleft + a.getLen(), lcleft + lc.getLen(), rcleft + rc.getLen()); // In this case we can pass on the TypeProvider reference that any ReturnStmts have been using. - RESULT = new LambdaExpr(((LexedValue>)arg_names.value).val.add(first_arg_name.val).build().reverse(), stmt_list, returnTypeHolder, currentLinesSupplier, rcright, startCol, endCol); + RESULT = new LambdaExpr(((LexedValue>)arg_names.value).getVal().add(first_arg_name.getVal()).build().reverse(), stmt_list, returnTypeHolder, currentLinesSupplier, rcright, startCol, endCol); :} | LPAR:lp RPAR:rp ARROW:a expr:implicit_return_expr {: Supplier currentLinesSupplier = - joinExprLines(new Line(lp.currentInputLine, lpright), new Line(rp.currentInputLine, rpright), new Line(a.currentInputLine, aright), new Line(implicit_return_expr.currentLine, implicit_return_expr.currentLineNumber)); + joinExprLines(new Line(lp.getCurrentInputLine(), lpright), new Line(rp.getCurrentInputLine(), rpright), new Line(a.getCurrentInputLine(), aright), new Line(implicit_return_expr.currentLine, implicit_return_expr.currentLineNumber)); int startCol = min(lpleft, rpleft, aleft, implicit_return_expr.startCol); - int endCol = max(lpleft + lp.len, rpleft + rp.len, aleft + a.len, implicit_return_expr.endCol); + int endCol = max(lpleft + lp.getLen(), rpleft + rp.getLen(), aleft + a.getLen(), implicit_return_expr.endCol); // In this case, we can generate our own settable reference to a TypeProvider for the ReturnStmt. AtomicReference returnTypeReference = new AtomicReference<>(null); @@ -2445,9 +2445,9 @@ lambda_function_expr ::= // so intentionally ignore the StmtListNode here for error lines. Pointers may be slightly off if programmer has // terrible indentation but in that case, fuck em. Supplier currentLinesSupplier = - joinExprLines(new Line(lp.currentInputLine, lpright), new Line(rp.currentInputLine, rpright), new Line(a.currentInputLine, aright), new Line(lc.currentInputLine, lcright), new Line(() -> "...", aright + 2 > rcright ? aright : aright + 1), new Line(rc.currentInputLine, rcright)); + joinExprLines(new Line(lp.getCurrentInputLine(), lpright), new Line(rp.getCurrentInputLine(), rpright), new Line(a.getCurrentInputLine(), aright), new Line(lc.getCurrentInputLine(), lcright), new Line(() -> "...", aright + 2 > rcright ? aright : aright + 1), new Line(rc.getCurrentInputLine(), rcright)); int startCol = min(lpleft, rpleft, aleft, lcleft, rcleft); - int endCol = max(lpleft + lp.len, rpleft + rp.len, aleft + a.len, lcleft + lc.len, rcleft + rc.len); + int endCol = max(lpleft + lp.getLen(), rpleft + rp.getLen(), aleft + a.getLen(), lcleft + lc.getLen(), rcleft + rc.getLen()); // In this case we can pass on the TypeProvider reference that any ReturnStmts have been using. RESULT = new LambdaExpr(stmt_list, returnTypeHolder, currentLinesSupplier, rcright, startCol, endCol); @@ -2460,12 +2460,12 @@ typed_lambda_function_expr ::= LPAR:lp function_args_types_list:backwards_arg_types RPAR:rp ARROW:a builtin_type:return_type LCURLY:lc stmt_list:stmt_list RCURLY:rc {: // FUNCTION Supplier currentLinesSupplier = - joinExprLines(new Line(((LexedValue) backwards_arg_types.value).currentInputLine, backwards_arg_types.right), new Line(a.currentInputLine, aright), new Line(((LexedValue) return_type.value).currentInputLine, return_type.right), new Line(lc.currentInputLine, lcright), new Line(() -> "...", lcright + 2 > rcright ? lcright : lcright + 1), new Line(rc.currentInputLine, rcright)); + joinExprLines(new Line(((LexedValue) backwards_arg_types.value).getCurrentInputLine(), backwards_arg_types.right), new Line(a.getCurrentInputLine(), aright), new Line(((LexedValue) return_type.value).getCurrentInputLine(), return_type.right), new Line(lc.getCurrentInputLine(), lcright), new Line(() -> "...", lcright + 2 > rcright ? lcright : lcright + 1), new Line(rc.getCurrentInputLine(), rcright)); int startCol = min(lpleft, backwards_arg_types.left, rpleft, aleft, return_type.left, lcleft, rcleft); - int endCol = max(lpleft + lp.len, backwards_arg_types.left + ((LexedValue) backwards_arg_types.value).len, aleft + a.len, lcleft + lc.len, rcleft + rc.len); + int endCol = max(lpleft + lp.getLen(), backwards_arg_types.left + ((LexedValue) backwards_arg_types.value).getLen(), aleft + a.getLen(), lcleft + lc.getLen(), rcleft + rc.getLen()); ImmutableMap args = - ((LexedValue>) backwards_arg_types.value).val.build(); + ((LexedValue>) backwards_arg_types.value).getVal().build(); // In this case we can pass on the TypeProvider reference that any ReturnStmts have been using. LambdaExpr lambda = new LambdaExpr(args.keySet().asList().reverse(), stmt_list, returnTypeHolder, currentLinesSupplier, rcright, startCol, endCol); RESULT = new CastExpr( @@ -2473,7 +2473,7 @@ typed_lambda_function_expr ::= Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes( args.values().asList().reverse().stream().map(argTypeProvider -> argTypeProvider.resolveType(scopedHeap)) .collect(ImmutableList.toImmutableList()), - ((LexedValue) return_type.value).val.resolveType(scopedHeap), + ((LexedValue) return_type.value).getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/ false), lambda, currentLinesSupplier, rcright, startCol, endCol @@ -2482,12 +2482,12 @@ typed_lambda_function_expr ::= | LAMBDA:lam LPAR:lp function_args_types_list:backwards_arg_types RPAR:rp ARROW:a LCURLY:lc stmt_list:stmt_list RCURLY:rc {: // CONSUMER Supplier currentLinesSupplier = - joinExprLines(new Line(lp.currentInputLine, lpright), new Line(((LexedValue) backwards_arg_types.value).currentInputLine, backwards_arg_types.right), new Line(lp.currentInputLine, lpright), new Line(a.currentInputLine, aright), new Line(lc.currentInputLine, lcright), new Line(() -> "...", lcright + 2 > rcright ? lcright : lcright + 1), new Line(rc.currentInputLine, rcright)); + joinExprLines(new Line(lp.getCurrentInputLine(), lpright), new Line(((LexedValue) backwards_arg_types.value).getCurrentInputLine(), backwards_arg_types.right), new Line(lp.getCurrentInputLine(), lpright), new Line(a.getCurrentInputLine(), aright), new Line(lc.getCurrentInputLine(), lcright), new Line(() -> "...", lcright + 2 > rcright ? lcright : lcright + 1), new Line(rc.getCurrentInputLine(), rcright)); int startCol = min(lpleft, backwards_arg_types.left, rpleft, aleft, lcleft, rcleft); - int endCol = max(lpleft + lp.len, backwards_arg_types.left + ((LexedValue)backwards_arg_types.value).len, rpleft + rp.len, aleft + a.len, lcleft + lc.len, rcleft + rc.len); + int endCol = max(lpleft + lp.getLen(), backwards_arg_types.left + ((LexedValue)backwards_arg_types.value).getLen(), rpleft + rp.getLen(), aleft + a.getLen(), lcleft + lc.getLen(), rcleft + rc.getLen()); ImmutableMap args = - ((LexedValue>) backwards_arg_types.value).val.build(); + ((LexedValue>) backwards_arg_types.value).getVal().build(); // In this case we can pass on the TypeProvider reference that any ReturnStmts have been using. LambdaExpr lambda = new LambdaExpr(args.keySet().asList().reverse(), stmt_list, returnTypeHolder, currentLinesSupplier, rcright, startCol, endCol); RESULT = new CastExpr( @@ -2506,16 +2506,16 @@ typed_lambda_function_expr ::= // so intentionally ignore the StmtListNode here for error lines. Pointers may be slightly off if programmer has // terrible indentation but in that case, *shrug*. Supplier currentLinesSupplier = - joinExprLines(new Line(lp.currentInputLine, lpright), new Line(rp.currentInputLine, rpright), new Line(a.currentInputLine, aright), new Line(((LexedValue) return_type.value).currentInputLine, return_type.right), new Line(lc.currentInputLine, lcright), new Line(() -> "...", aright + 2 > rcright ? aright : aright + 1), new Line(rc.currentInputLine, rcright)); + joinExprLines(new Line(lp.getCurrentInputLine(), lpright), new Line(rp.getCurrentInputLine(), rpright), new Line(a.getCurrentInputLine(), aright), new Line(((LexedValue) return_type.value).getCurrentInputLine(), return_type.right), new Line(lc.getCurrentInputLine(), lcright), new Line(() -> "...", aright + 2 > rcright ? aright : aright + 1), new Line(rc.getCurrentInputLine(), rcright)); int startCol = min(lpleft, rpleft, aleft, return_type.left, lcleft, rcleft); - int endCol = max(lpleft + lp.len, rpleft + rp.len, aleft + a.len, return_type.left + ((LexedValue) return_type.value).len, lcleft + lc.len, rcleft + rc.len); + int endCol = max(lpleft + lp.getLen(), rpleft + rp.getLen(), aleft + a.getLen(), return_type.left + ((LexedValue) return_type.value).getLen(), lcleft + lc.getLen(), rcleft + rc.getLen()); // In this case we can pass on the TypeProvider reference that any ReturnStmts have been using. LambdaExpr lambda = new LambdaExpr(stmt_list, returnTypeHolder, currentLinesSupplier, rcright, startCol, endCol); RESULT = new CastExpr( (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType( - ((LexedValue) return_type.value).val.resolveType(scopedHeap), + ((LexedValue) return_type.value).getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/ false), lambda, currentLinesSupplier, rcright, startCol, endCol @@ -2527,15 +2527,15 @@ identifier_list ::= IDENTIFIER:arg_name COMMA:c identifier_list:tail {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentInputLine, arg_nameright), new Line(c.currentInputLine, cright), new Line(((LexedValue)tail.value).currentInputLine, tail.right)); + joinExprLines(new Line(arg_name.getCurrentInputLine(), arg_nameright), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue)tail.value).getCurrentInputLine(), tail.right)); int startCol = min(arg_nameleft, cleft); - int endCol = max(arg_nameleft + arg_name.len, cleft + c.len); + int endCol = max(arg_nameleft + arg_name.getLen(), cleft + c.getLen()); RESULT = new Symbol( -1, startCol, tail.right, // line number - new LexedValue( - ((LexedValue>)tail.value).val.add(arg_name.val), + LexedValue.create( + ((LexedValue>)tail.value).getVal().add(arg_name.getVal()), currentLinesSupplier, endCol - startCol) ); @@ -2546,10 +2546,10 @@ identifier_list ::= -1, arg_nameleft, arg_nameright, // line number - new LexedValue( - ImmutableList.builder().add(arg_name.val), - arg_name.currentInputLine, - arg_name.len) + LexedValue.create( + ImmutableList.builder().add(arg_name.getVal()), + arg_name.getCurrentInputLine(), + arg_name.getLen()) ); :} ; @@ -2563,10 +2563,10 @@ consumer_function_definition_stmt ::= returnTypeHolder = null; } // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ConsumerFunctionDefinitionStmt(name.val, argTypesMap, stmt_list, /*explicitlyAnnotatedBlocking=*/false); + RESULT = new ConsumerFunctionDefinitionStmt(name.getVal(), argTypesMap, stmt_list, /*explicitlyAnnotatedBlocking=*/false); :} | USING LPAR injected_keys_list:bw_injected_keys RPAR CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR LCURLY stmt_list:stmt_list RCURLY {: @@ -2576,11 +2576,11 @@ consumer_function_definition_stmt ::= returnTypeHolder = null; } // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); - RESULT = new ConsumerFunctionDefinitionStmt(name.val, argTypesMap, Optional.of(injectedKeysList), stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); + RESULT = new ConsumerFunctionDefinitionStmt(name.getVal(), argTypesMap, Optional.of(injectedKeysList), stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); :} | BLOCKING CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR LCURLY stmt_list:stmt_list RCURLY {: @@ -2590,10 +2590,10 @@ consumer_function_definition_stmt ::= returnTypeHolder = null; } // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ConsumerFunctionDefinitionStmt(name.val, argTypesMap, stmt_list, /*explicitlyAnnotatedBlocking=*/true); + RESULT = new ConsumerFunctionDefinitionStmt(name.getVal(), argTypesMap, stmt_list, /*explicitlyAnnotatedBlocking=*/true); :} | USING LPAR injected_keys_list:bw_injected_keys RPAR BLOCKING CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR LCURLY stmt_list:stmt_list RCURLY {: @@ -2603,11 +2603,11 @@ consumer_function_definition_stmt ::= returnTypeHolder = null; } // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); - RESULT = new ConsumerFunctionDefinitionStmt(name.val, argTypesMap, Optional.of(injectedKeysList), stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); + RESULT = new ConsumerFunctionDefinitionStmt(name.getVal(), argTypesMap, Optional.of(injectedKeysList), stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); :} | generic_blocking_on:generic_blocking_on CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR LCURLY stmt_list:stmt_list RCURLY {: @@ -2620,7 +2620,7 @@ consumer_function_definition_stmt ::= ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ConsumerFunctionDefinitionStmt(name.val, argTypesMap, Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); + RESULT = new ConsumerFunctionDefinitionStmt(name.getVal(), argTypesMap, Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); :} | USING LPAR injected_keys_list:bw_injected_keys RPAR generic_blocking_on:generic_blocking_on CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR LCURLY stmt_list:stmt_list RCURLY {: @@ -2633,8 +2633,8 @@ consumer_function_definition_stmt ::= ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); - RESULT = new ConsumerFunctionDefinitionStmt(name.val, argTypesMap, Optional.of(injectedKeysList), stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); + RESULT = new ConsumerFunctionDefinitionStmt(name.getVal(), argTypesMap, Optional.of(injectedKeysList), stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); :} ; @@ -2647,13 +2647,13 @@ generic_consumer_function_definition_stmt ::= returnTypeHolder = null; } // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new GenericFunctionDefinitionStmt(name.val, /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new GenericFunctionDefinitionStmt(name.getVal(), /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); :} | REQUIRES LPAR required_contracts:required_contracts RPAR CONSUMER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR function_args_types_list:backwards_arg_types RPAR LCURLY stmt_list:stmt_list RCURLY {: @@ -2663,14 +2663,14 @@ generic_consumer_function_definition_stmt ::= returnTypeHolder = null; } // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); + ((LexedValue>)generic_types.value).getVal().build().reverse(); RESULT = new GenericFunctionDefinitionStmt( - name.val, (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); + name.getVal(), (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); :} | BLOCKING CONSUMER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR function_args_types_list:backwards_arg_types RPAR LCURLY stmt_list:stmt_list RCURLY {: @@ -2680,13 +2680,13 @@ generic_consumer_function_definition_stmt ::= returnTypeHolder = null; } // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new GenericFunctionDefinitionStmt(name.val, /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new GenericFunctionDefinitionStmt(name.getVal(), /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); :} | REQUIRES LPAR required_contracts:required_contracts RPAR BLOCKING CONSUMER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR function_args_types_list:backwards_arg_types RPAR LCURLY stmt_list:stmt_list RCURLY {: @@ -2696,14 +2696,14 @@ generic_consumer_function_definition_stmt ::= returnTypeHolder = null; } // This production matched a function defined by a list of statements followed by a return Expr to eval. - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); + ((LexedValue>)generic_types.value).getVal().build().reverse(); RESULT = new GenericFunctionDefinitionStmt( - name.val, (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); + name.getVal(), (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); :} | generic_blocking_on:generic_blocking_on CONSUMER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR LCURLY stmt_list:stmt_list RCURLY {: @@ -2718,9 +2718,9 @@ generic_consumer_function_definition_stmt ::= ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); + ((LexedValue>)generic_types.value).getVal().build().reverse(); RESULT = new GenericFunctionDefinitionStmt( - name.val, /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); + name.getVal(), /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); :} | REQUIRES LPAR required_contracts:required_contracts RPAR generic_blocking_on:generic_blocking_on CONSUMER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR LCURLY stmt_list:stmt_list RCURLY {: @@ -2735,9 +2735,9 @@ generic_consumer_function_definition_stmt ::= ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); + ((LexedValue>)generic_types.value).getVal().build().reverse(); RESULT = new GenericFunctionDefinitionStmt( - name.val, (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); + name.getVal(), (ImmutableListMultimap>) required_contracts.build(), genericTypesList, argTypesMap, /*optionalInjectedKeysTypes=*/Optional.empty(), stmt_list, /*explicitlyAnnotatedBlocking=*/null, Optional.of(generic_blocking_on)); :} ; @@ -2745,36 +2745,36 @@ provider_function_definition_stmt ::= PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; - RESULT = new ProviderFunctionDefinitionStmt(name.val, outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false); + RESULT = new ProviderFunctionDefinitionStmt(name.getVal(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false); :} | USING LPAR injected_keys_list:bw_injected_keys RPAR PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); - RESULT = new ProviderFunctionDefinitionStmt(name.val, Optional.of(injectedKeysList), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); + RESULT = new ProviderFunctionDefinitionStmt(name.getVal(), Optional.of(injectedKeysList), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false); :} | BLOCKING PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; - RESULT = new ProviderFunctionDefinitionStmt(name.val, outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true); + RESULT = new ProviderFunctionDefinitionStmt(name.getVal(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true); :} | USING LPAR injected_keys_list:bw_injected_keys RPAR BLOCKING PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); - RESULT = new ProviderFunctionDefinitionStmt(name.val, Optional.of(injectedKeysList), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse().stream().map(i -> i.toInjectedKey()).collect(ImmutableList.toImmutableList()); + RESULT = new ProviderFunctionDefinitionStmt(name.getVal(), Optional.of(injectedKeysList), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true); :} ; @@ -2782,46 +2782,46 @@ generic_provider_function_definition_stmt ::= PROVIDER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new GenericFunctionDefinitionStmt(name.val, /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, ImmutableMap.of(), /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new GenericFunctionDefinitionStmt(name.getVal(), /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, ImmutableMap.of(), /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); :} | REQUIRES LPAR required_contracts:required_contracts RPAR PROVIDER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new GenericFunctionDefinitionStmt(name.val, (ImmutableListMultimap>) required_contracts.build(), genericTypesList, ImmutableMap.of(), /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new GenericFunctionDefinitionStmt(name.getVal(), (ImmutableListMultimap>) required_contracts.build(), genericTypesList, ImmutableMap.of(), /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/false, Optional.empty()); :} | BLOCKING PROVIDER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new GenericFunctionDefinitionStmt(name.val, /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, ImmutableMap.of(), /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new GenericFunctionDefinitionStmt(name.getVal(), /*requiredContracts=*/ImmutableListMultimap.of(), genericTypesList, ImmutableMap.of(), /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); :} | REQUIRES LPAR required_contracts:required_contracts RPAR BLOCKING PROVIDER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR RPAR ARROW builtin_type:output_type LCURLY stmt_list:stmt_list RCURLY {: // Set the return type for all of the ReturnStmts that are waiting on it and reset the holder. - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); returnTypeHolder.set(outputTypeProvider); returnTypeHolder = null; ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new GenericFunctionDefinitionStmt(name.val, (ImmutableListMultimap>) required_contracts.build(), genericTypesList, ImmutableMap.of(), /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new GenericFunctionDefinitionStmt(name.getVal(), (ImmutableListMultimap>) required_contracts.build(), genericTypesList, ImmutableMap.of(), /*optionalInjectedKeysTypes=*/Optional.empty(), outputTypeProvider, stmt_list, /*explicitlyAnnotatedBlocking=*/true, Optional.empty()); :} ; @@ -2829,17 +2829,17 @@ injected_keys_list ::= identifier:key_name COLON:colon builtin_type:t COMMA:comma injected_keys_list:tail {: Supplier currentLinesSupplier = - joinExprLines(new Line(key_name.currentLine, key_name.currentLineNumber), new Line(colon.currentInputLine, colonright), new Line(((LexedValue) t.value).currentInputLine, t.right), new Line(comma.currentInputLine, commaright), new Line(((LexedValue) tail.value).currentInputLine, tail.right)); + joinExprLines(new Line(key_name.currentLine, key_name.currentLineNumber), new Line(colon.getCurrentInputLine(), colonright), new Line(((LexedValue) t.value).getCurrentInputLine(), t.right), new Line(comma.getCurrentInputLine(), commaright), new Line(((LexedValue) tail.value).getCurrentInputLine(), tail.right)); int startCol = min(key_name.startCol, colonleft, t.left, commaleft, tail.left); - int endCol = max(key_name.endCol, colonleft + colon.len, t.left + ((LexedValue) t.value).len, commaleft + comma.len, tail.left + ((LexedValue) tail.value).len); + int endCol = max(key_name.endCol, colonleft + colon.getLen(), t.left + ((LexedValue) t.value).getLen(), commaleft + comma.getLen(), tail.left + ((LexedValue) tail.value).getLen()); RESULT = new Symbol( -1, startCol, t.right, // line number - new LexedValue( - ((LexedValue>) tail.value).val - .add(new InjectedKeyIdentifier(key_name, ((LexedValue) t.value).val, Optional.empty())), + LexedValue.create( + ((LexedValue>) tail.value).getVal() + .add(new InjectedKeyIdentifier(key_name, ((LexedValue) t.value).getVal(), Optional.empty())), currentLinesSupplier, endCol - startCol) ); @@ -2847,17 +2847,17 @@ injected_keys_list ::= | identifier:key_name COLON:colon builtin_type:t AS IDENTIFIER:alias COMMA:comma injected_keys_list:tail {: Supplier currentLinesSupplier = - joinExprLines(new Line(key_name.currentLine, key_name.currentLineNumber), new Line(colon.currentInputLine, colonright), new Line(((LexedValue) t.value).currentInputLine, t.right), new Line(comma.currentInputLine, commaright), new Line(((LexedValue) tail.value).currentInputLine, tail.right)); + joinExprLines(new Line(key_name.currentLine, key_name.currentLineNumber), new Line(colon.getCurrentInputLine(), colonright), new Line(((LexedValue) t.value).getCurrentInputLine(), t.right), new Line(comma.getCurrentInputLine(), commaright), new Line(((LexedValue) tail.value).getCurrentInputLine(), tail.right)); int startCol = min(key_name.startCol, colonleft, t.left, commaleft, tail.left); - int endCol = max(key_name.endCol, colonleft + colon.len, t.left + ((LexedValue) t.value).len, commaleft + comma.len, tail.left + ((LexedValue) tail.value).len); + int endCol = max(key_name.endCol, colonleft + colon.getLen(), t.left + ((LexedValue) t.value).getLen(), commaleft + comma.getLen(), tail.left + ((LexedValue) tail.value).getLen()); RESULT = new Symbol( -1, startCol, t.right, // line number - new LexedValue( - ((LexedValue>) tail.value).val - .add(new InjectedKeyIdentifier(key_name, ((LexedValue) t.value).val, Optional.of(alias.val))), + LexedValue.create( + ((LexedValue>) tail.value).getVal() + .add(new InjectedKeyIdentifier(key_name, ((LexedValue) t.value).getVal(), Optional.of(alias.getVal()))), currentLinesSupplier, endCol - startCol) ); @@ -2865,16 +2865,16 @@ injected_keys_list ::= | identifier:key_name COLON:c builtin_type:t {: Supplier currentLinesSupplier = - joinExprLines(new Line(key_name.currentLine, key_name.currentLineNumber), new Line(c.currentInputLine, cright), new Line(((LexedValue) t.value).currentInputLine, t.right)); + joinExprLines(new Line(key_name.currentLine, key_name.currentLineNumber), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue) t.value).getCurrentInputLine(), t.right)); int startCol = min(key_name.startCol, cleft, t.left); - int endCol = max(key_name.endCol, cleft + c.len, t.left + ((LexedValue) t.value).len); + int endCol = max(key_name.endCol, cleft + c.getLen(), t.left + ((LexedValue) t.value).getLen()); RESULT = new Symbol( -1, startCol, t.right, // line number - new LexedValue( - ImmutableList.builder().add(new InjectedKeyIdentifier(key_name, ((LexedValue) t.value).val, Optional.empty())), + LexedValue.create( + ImmutableList.builder().add(new InjectedKeyIdentifier(key_name, ((LexedValue) t.value).getVal(), Optional.empty())), currentLinesSupplier, endCol - startCol) ); @@ -2882,16 +2882,16 @@ injected_keys_list ::= | identifier:key_name COLON:c builtin_type:t AS IDENTIFIER:alias {: Supplier currentLinesSupplier = - joinExprLines(new Line(key_name.currentLine, key_name.currentLineNumber), new Line(c.currentInputLine, cright), new Line(((LexedValue) t.value).currentInputLine, t.right)); + joinExprLines(new Line(key_name.currentLine, key_name.currentLineNumber), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue) t.value).getCurrentInputLine(), t.right)); int startCol = min(key_name.startCol, cleft, t.left); - int endCol = max(key_name.endCol, cleft + c.len, t.left + ((LexedValue) t.value).len); + int endCol = max(key_name.endCol, cleft + c.getLen(), t.left + ((LexedValue) t.value).getLen()); RESULT = new Symbol( -1, startCol, t.right, // line number - new LexedValue( - ImmutableList.builder().add(new InjectedKeyIdentifier(key_name, ((LexedValue) t.value).val, Optional.of(alias.val))), + LexedValue.create( + ImmutableList.builder().add(new InjectedKeyIdentifier(key_name, ((LexedValue) t.value).getVal(), Optional.of(alias.getVal()))), currentLinesSupplier, endCol - startCol) ); @@ -2904,16 +2904,16 @@ function_args_types_list ::= IDENTIFIER:arg_name COLON:colon builtin_type:t COMMA:comma function_args_types_list:tail {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentInputLine, arg_nameright), new Line(colon.currentInputLine, colonright), new Line(((LexedValue) t.value).currentInputLine, t.right), new Line(comma.currentInputLine, commaright), new Line(((LexedValue) tail.value).currentInputLine, tail.right)); + joinExprLines(new Line(arg_name.getCurrentInputLine(), arg_nameright), new Line(colon.getCurrentInputLine(), colonright), new Line(((LexedValue) t.value).getCurrentInputLine(), t.right), new Line(comma.getCurrentInputLine(), commaright), new Line(((LexedValue) tail.value).getCurrentInputLine(), tail.right)); int startCol = min(arg_nameleft, colonleft, t.left, commaleft, tail.left); - int endCol = max(arg_nameleft + arg_name.len, colonleft + colon.len, t.left + ((LexedValue) t.value).len, commaleft + comma.len, tail.left + ((LexedValue) tail.value).len); + int endCol = max(arg_nameleft + arg_name.getLen(), colonleft + colon.getLen(), t.left + ((LexedValue) t.value).getLen(), commaleft + comma.getLen(), tail.left + ((LexedValue) tail.value).getLen()); RESULT = new Symbol( -1, startCol, t.right, // line number - new LexedValue( - ((LexedValue>) tail.value).val.put(arg_name.val, ((LexedValue) t.value).val), + LexedValue.create( + ((LexedValue>) tail.value).getVal().put(arg_name.getVal(), ((LexedValue) t.value).getVal()), currentLinesSupplier, endCol - startCol) ); @@ -2921,16 +2921,16 @@ function_args_types_list ::= | IDENTIFIER:arg_name COLON:c builtin_type:t {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentInputLine, arg_nameright), new Line(c.currentInputLine, cright), new Line(((LexedValue) t.value).currentInputLine, t.right)); + joinExprLines(new Line(arg_name.getCurrentInputLine(), arg_nameright), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue) t.value).getCurrentInputLine(), t.right)); int startCol = min(arg_nameleft, cleft, t.left); - int endCol = max(arg_nameleft + arg_name.len, cleft + c.len, t.left + ((LexedValue) t.value).len); + int endCol = max(arg_nameleft + arg_name.getLen(), cleft + c.getLen(), t.left + ((LexedValue) t.value).getLen()); RESULT = new Symbol( -1, startCol, t.right, // line number - new LexedValue( - ImmutableMap.builder().put(arg_name.val, ((LexedValue) t.value).val), + LexedValue.create( + ImmutableMap.builder().put(arg_name.getVal(), ((LexedValue) t.value).getVal()), currentLinesSupplier, endCol - startCol) ); @@ -2945,16 +2945,16 @@ function_args_types_list_identifiers ::= identifier:arg_name COLON:colon builtin_type:t COMMA:comma function_args_types_list_identifiers:tail {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentLine, arg_name.currentLineNumber), new Line(colon.currentInputLine, colonright), new Line(((LexedValue) t.value).currentInputLine, t.right), new Line(comma.currentInputLine, commaright), new Line(((LexedValue) tail.value).currentInputLine, tail.right)); + joinExprLines(new Line(arg_name.currentLine, arg_name.currentLineNumber), new Line(colon.getCurrentInputLine(), colonright), new Line(((LexedValue) t.value).getCurrentInputLine(), t.right), new Line(comma.getCurrentInputLine(), commaright), new Line(((LexedValue) tail.value).getCurrentInputLine(), tail.right)); int startCol = min(arg_name.startCol, colonleft, t.left, commaleft, tail.left); - int endCol = max(arg_name.endCol, colonleft + colon.len, t.left + ((LexedValue) t.value).len, commaleft + comma.len, tail.left + ((LexedValue) tail.value).len); + int endCol = max(arg_name.endCol, colonleft + colon.getLen(), t.left + ((LexedValue) t.value).getLen(), commaleft + comma.getLen(), tail.left + ((LexedValue) tail.value).getLen()); RESULT = new Symbol( -1, startCol, t.right, // line number - new LexedValue( - ((LexedValue>) tail.value).val.put(arg_name, ((LexedValue) t.value).val), + LexedValue.create( + ((LexedValue>) tail.value).getVal().put(arg_name, ((LexedValue) t.value).getVal()), currentLinesSupplier, endCol - startCol) ); @@ -2962,16 +2962,16 @@ function_args_types_list_identifiers ::= | identifier:arg_name COLON:c builtin_type:t {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentLine, arg_name.currentLineNumber), new Line(c.currentInputLine, cright), new Line(((LexedValue) t.value).currentInputLine, t.right)); + joinExprLines(new Line(arg_name.currentLine, arg_name.currentLineNumber), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue) t.value).getCurrentInputLine(), t.right)); int startCol = min(arg_name.startCol, cleft, t.left); - int endCol = max(arg_name.endCol, cleft + c.len, t.left + ((LexedValue) t.value).len); + int endCol = max(arg_name.endCol, cleft + c.getLen(), t.left + ((LexedValue) t.value).getLen()); RESULT = new Symbol( -1, startCol, t.right, // line number - new LexedValue( - ImmutableMap.builder().put(arg_name, ((LexedValue) t.value).val), + LexedValue.create( + ImmutableMap.builder().put(arg_name, ((LexedValue) t.value).getVal()), currentLinesSupplier, endCol - startCol) ); @@ -2981,19 +2981,19 @@ function_args_types_list_identifiers ::= procedure_args_w_generic_blocking ::= IDENTIFIER:arg_name COLON maybe_blocking_procedure_types:maybe_blocking_proc COMMA procedure_args_w_generic_blocking:args_w_generic_blocking {: - RESULT = args_w_generic_blocking.put(arg_name.val, maybe_blocking_proc); + RESULT = args_w_generic_blocking.put(arg_name.getVal(), maybe_blocking_proc); :} | IDENTIFIER:arg_name COLON builtin_type:t COMMA procedure_args_w_generic_blocking:args_w_generic_blocking {: - RESULT = args_w_generic_blocking.put(arg_name.val, ((LexedValue) t.value).val); + RESULT = args_w_generic_blocking.put(arg_name.getVal(), ((LexedValue) t.value).getVal()); :} | IDENTIFIER:arg_name COLON maybe_blocking_procedure_types:maybe_blocking_proc {: - RESULT = ImmutableMap.builder().put(arg_name.val, maybe_blocking_proc); + RESULT = ImmutableMap.builder().put(arg_name.getVal(), maybe_blocking_proc); :} | IDENTIFIER:arg_name COLON builtin_type:t {: - RESULT = ImmutableMap.builder().put(arg_name.val, ((LexedValue) t.value).val); + RESULT = ImmutableMap.builder().put(arg_name.getVal(), ((LexedValue) t.value).getVal()); :} ; @@ -3015,9 +3015,9 @@ return_stmt ::= graph_function_definition_stmt ::= GRAPH FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list_identifiers:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY root_node:root non_root_nodes_list:non_root_nodes RCURLY {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); @@ -3026,7 +3026,7 @@ graph_function_definition_stmt ::= // is syntactically guaranteed to have a root node, so there's no concern that we don't know the return type. RESULT = new GraphFunctionDefinitionStmt( - name.val, + name.getVal(), argTypesMap, outputTypeProvider, root, @@ -3034,9 +3034,9 @@ graph_function_definition_stmt ::= :} | GRAPH FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list_identifiers:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY non_root_nodes_list:non_root_nodes root_node:root RCURLY {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); @@ -3045,7 +3045,7 @@ graph_function_definition_stmt ::= // is syntactically guaranteed to have a root node, so there's no concern that we don't know the return type. RESULT = new GraphFunctionDefinitionStmt( - name.val, + name.getVal(), argTypesMap, outputTypeProvider, root, @@ -3053,9 +3053,9 @@ graph_function_definition_stmt ::= :} | USING LPAR injected_keys_list:bw_injected_keys RPAR GRAPH FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list_identifiers:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY root_node:root non_root_nodes_list:non_root_nodes RCURLY {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); @@ -3063,9 +3063,9 @@ graph_function_definition_stmt ::= // because there's only going to be a single return from a graph function, and by definition every graph function // is syntactically guaranteed to have a root node, so there's no concern that we don't know the return type. - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse(); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse(); RESULT = new GraphFunctionDefinitionStmt( - name.val, + name.getVal(), argTypesMap, Optional.of(injectedKeysList), outputTypeProvider, @@ -3074,9 +3074,9 @@ graph_function_definition_stmt ::= :} | USING LPAR injected_keys_list:bw_injected_keys RPAR GRAPH FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list_identifiers:backwards_arg_types RPAR ARROW builtin_type:output_type LCURLY non_root_nodes_list:non_root_nodes root_node:root RCURLY {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); @@ -3084,9 +3084,9 @@ graph_function_definition_stmt ::= // because there's only going to be a single return from a graph function, and by definition every graph function // is syntactically guaranteed to have a root node, so there's no concern that we don't know the return type. - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse(); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse(); RESULT = new GraphFunctionDefinitionStmt( - name.val, + name.getVal(), argTypesMap, Optional.of(injectedKeysList), outputTypeProvider, @@ -3101,43 +3101,43 @@ graph_function_definition_stmt ::= graph_provider_definition_stmt ::= GRAPH PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type LCURLY root_node:root non_root_nodes_list:non_root_nodes RCURLY {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); // Unlike the various procedure definition stmt productions, there's no need to fiddle with the returnTypeHolder // because there's only going to be a single return from a graph function, and by definition every graph function // is syntactically guaranteed to have a root node, so there's no concern that we don't know the return type. RESULT = new GraphProviderDefinitionStmt( - name.val, + name.getVal(), outputTypeProvider, root, non_root_nodes.build().reverse()); :} | GRAPH PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type LCURLY non_root_nodes_list:non_root_nodes root_node:root RCURLY {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); // Unlike the various procedure definition stmt productions, there's no need to fiddle with the returnTypeHolder // because there's only going to be a single return from a graph function, and by definition every graph function // is syntactically guaranteed to have a root node, so there's no concern that we don't know the return type. RESULT = new GraphProviderDefinitionStmt( - name.val, + name.getVal(), outputTypeProvider, root, non_root_nodes.build().reverse()); :} | USING LPAR injected_keys_list:bw_injected_keys RPAR GRAPH PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type LCURLY root_node:root non_root_nodes_list:non_root_nodes RCURLY {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); // Unlike the various procedure definition stmt productions, there's no need to fiddle with the returnTypeHolder // because there's only going to be a single return from a graph function, and by definition every graph function // is syntactically guaranteed to have a root node, so there's no concern that we don't know the return type. - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse(); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse(); RESULT = new GraphProviderDefinitionStmt( - name.val, + name.getVal(), Optional.of(injectedKeysList), outputTypeProvider, root, @@ -3145,15 +3145,15 @@ graph_provider_definition_stmt ::= :} | USING LPAR injected_keys_list:bw_injected_keys RPAR GRAPH PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type LCURLY non_root_nodes_list:non_root_nodes root_node:root RCURLY {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); // Unlike the various procedure definition stmt productions, there's no need to fiddle with the returnTypeHolder // because there's only going to be a single return from a graph function, and by definition every graph function // is syntactically guaranteed to have a root node, so there's no concern that we don't know the return type. - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse(); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse(); RESULT = new GraphProviderDefinitionStmt( - name.val, + name.getVal(), Optional.of(injectedKeysList), outputTypeProvider, root, @@ -3164,37 +3164,37 @@ graph_provider_definition_stmt ::= graph_consumer_definition_stmt ::= GRAPH CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list_identifiers:backwards_arg_types RPAR LCURLY root_node:root non_root_nodes_list:non_root_nodes RCURLY {: - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); RESULT = new GraphConsumerDefinitionStmt( - name.val, + name.getVal(), argTypesMap, root, non_root_nodes.build().reverse()); :} | GRAPH CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list_identifiers:backwards_arg_types RPAR LCURLY non_root_nodes_list:non_root_nodes root_node:root RCURLY {: - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); RESULT = new GraphConsumerDefinitionStmt( - name.val, + name.getVal(), argTypesMap, root, non_root_nodes.build().reverse()); :} | USING LPAR injected_keys_list:bw_injected_keys RPAR GRAPH CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list_identifiers:backwards_arg_types RPAR LCURLY root_node:root non_root_nodes_list:non_root_nodes RCURLY {: - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse(); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse(); RESULT = new GraphConsumerDefinitionStmt( - name.val, + name.getVal(), argTypesMap, Optional.of(injectedKeysList), root, @@ -3202,13 +3202,13 @@ graph_consumer_definition_stmt ::= :} | USING LPAR injected_keys_list:bw_injected_keys RPAR GRAPH CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list_identifiers:backwards_arg_types RPAR LCURLY non_root_nodes_list:non_root_nodes root_node:root RCURLY {: - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).val.build().reverse(); + ImmutableList injectedKeysList = ((LexedValue>) bw_injected_keys.value).getVal().build().reverse(); RESULT = new GraphConsumerDefinitionStmt( - name.val, + name.getVal(), argTypesMap, Optional.of(injectedKeysList), root, @@ -3218,12 +3218,12 @@ graph_consumer_definition_stmt ::= root_node ::= ROOT IDENTIFIER:name LEFT_ARROW expr:expr SEMICOLON - {: RESULT = new GraphNodeDefinitionStmt(name.val, expr); :} + {: RESULT = new GraphNodeDefinitionStmt(name.getVal(), expr); :} ; non_root_node ::= NODE IDENTIFIER:name LEFT_ARROW expr:expr SEMICOLON - {: RESULT = new GraphNodeDefinitionStmt(name.val, expr); :} + {: RESULT = new GraphNodeDefinitionStmt(name.getVal(), expr); :} ; non_root_nodes_list ::= @@ -3235,23 +3235,23 @@ non_root_nodes_list ::= node_reference ::= AT IDENTIFIER:identifier - {: RESULT = new GraphNodeReferenceExpr(identifier.val, identifier.currentInputLine, identifierright, identifierleft, identifierleft + identifier.len); :} + {: RESULT = new GraphNodeReferenceExpr(identifier.getVal(), identifier.getCurrentInputLine(), identifierright, identifierleft, identifierleft + identifier.getLen()); :} ; contract_definition_stmt ::= CONTRACT IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LCURLY contract_signature_defs_list:contract_signature_defs_backwards RCURLY {: ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractDefinitionStmt(name.val, genericTypesList, contract_signature_defs_backwards.build().reverse()); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractDefinitionStmt(name.getVal(), genericTypesList, contract_signature_defs_backwards.build().reverse()); :} | CONTRACT IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types IMPLICATION_ARROW identifier_list:implied_types R_ANGLE_BRACKET LCURLY contract_signature_defs_list:contract_signature_defs_backwards RCURLY {: ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); + ((LexedValue>)generic_types.value).getVal().build().reverse(); ImmutableList impliedTypesList = - ((LexedValue>)implied_types.value).val.build().reverse(); - RESULT = new ContractDefinitionStmt(name.val, genericTypesList, impliedTypesList, contract_signature_defs_backwards.build().reverse()); + ((LexedValue>)implied_types.value).getVal().build().reverse(); + RESULT = new ContractDefinitionStmt(name.getVal(), genericTypesList, impliedTypesList, contract_signature_defs_backwards.build().reverse()); :} ; @@ -3270,89 +3270,89 @@ contract_procedure_signature_definition_stmt ::= // FUNCTIONS FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} | BLOCKING FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} | generic_blocking_on:generic_blocking_on FUNCTION_TYPE IDENTIFIER:name LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), /*optionalGenericTypesList=*/ Optional.empty()); :} | FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), Optional.of(genericTypesList)); :} | BLOCKING FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.of(genericTypesList)); :} | generic_blocking_on:generic_blocking_on FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), Optional.of(genericTypesList)); :} // CONSUMERS | CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR SEMICOLON {: - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} | BLOCKING CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR SEMICOLON {: - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} | generic_blocking_on:generic_blocking_on CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR SEMICOLON {: ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), /*optionalGenericTypesList=*/ Optional.empty()); :} | CONSUMER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR function_args_types_list:backwards_arg_types RPAR SEMICOLON {: - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), Optional.of(genericTypesList)); :} | BLOCKING CONSUMER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR SEMICOLON {: @@ -3360,8 +3360,8 @@ contract_procedure_signature_definition_stmt ::= ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.of(genericTypesList)); :} | generic_blocking_on:generic_blocking_on CONSUMER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR SEMICOLON {: @@ -3369,27 +3369,27 @@ contract_procedure_signature_definition_stmt ::= ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), Optional.of(genericTypesList)); :} // PROVIDERS | PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.empty(), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.empty(), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} | BLOCKING PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.empty(), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.empty(), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} ; contract_implementation_stmt ::= IMPLEMENT IDENTIFIER:contract_name L_ANGLE_BRACKET builtin_types_list:concrete_types R_ANGLE_BRACKET AS IDENTIFIER:implementation_name LCURLY contract_implementations_list:contract_impls RCURLY {: - RESULT = new ContractImplementationStmt(contract_name.val, implementation_name.val, ((LexedValue>) concrete_types.value).val, contract_impls.build().reverse()); + RESULT = new ContractImplementationStmt(contract_name.getVal(), implementation_name.getVal(), ((LexedValue>) concrete_types.value).getVal(), contract_impls.build().reverse()); :} ; @@ -3481,28 +3481,28 @@ pipe_chain ::= function_call_expr ::= non_lambda_exprs:function LPAR:l args_list:args RPAR:r {: - Supplier currentLinesSupplier = joinExprLines(new Line(function), new Line(l.currentInputLine, lright), new Line(args), new Line(r.currentInputLine, rright)); + Supplier currentLinesSupplier = joinExprLines(new Line(function), new Line(l.getCurrentInputLine(), lright), new Line(args), new Line(r.getCurrentInputLine(), rright)); int startCol = min(function.startCol, lleft, args.left, rleft); - int endCol = max(function.endCol, lleft + l.len, args.left + ((LexedValue)args.value).len, rleft + r.len); + int endCol = max(function.endCol, lleft + l.getLen(), args.left + ((LexedValue)args.value).getLen(), rleft + r.getLen()); if (function instanceof IdentifierReferenceTerm) { // Here, we may actually need to do some more complex handling of generic functions or something like a user-defined-type constructor. - RESULT = new FunctionCallExpr(((IdentifierReferenceTerm) function).identifier, ((LexedValue>)args.value).val.build().reverse(), currentLinesSupplier, rright, startCol, endCol); + RESULT = new FunctionCallExpr(((IdentifierReferenceTerm) function).identifier, ((LexedValue>)args.value).getVal().build().reverse(), currentLinesSupplier, rright, startCol, endCol); } else { - RESULT = new FirstClassFunctionCallExpr(function, ((LexedValue>)args.value).val.build().reverse(), currentLinesSupplier, rright, startCol, endCol); + RESULT = new FirstClassFunctionCallExpr(function, ((LexedValue>)args.value).getVal().build().reverse(), currentLinesSupplier, rright, startCol, endCol); } :} | identifier:contract_name COLON_COLON:c identifier:function_name LPAR:l args_list:args RPAR:r {: - Supplier currentLinesSupplier = joinExprLines(new Line(contract_name), new Line(c.currentInputLine, cright), new Line(function_name), new Line(l.currentInputLine, lright), new Line(args), new Line(r.currentInputLine, rright)); + Supplier currentLinesSupplier = joinExprLines(new Line(contract_name), new Line(c.getCurrentInputLine(), cright), new Line(function_name), new Line(l.getCurrentInputLine(), lright), new Line(args), new Line(r.getCurrentInputLine(), rright)); int startCol = min(contract_name.startCol, cleft, function_name.startCol, lleft, args.left, rleft); - int endCol = max(contract_name.endCol, cleft + c.len, function_name.endCol, lleft + l.len, args.left + ((LexedValue)args.value).len, rleft + r.len); + int endCol = max(contract_name.endCol, cleft + c.getLen(), function_name.endCol, lleft + l.getLen(), args.left + ((LexedValue)args.value).getLen(), rleft + r.getLen()); RESULT = new ContractFunctionCallExpr( ((IdentifierReferenceTerm) contract_name).identifier, contract_name, ((IdentifierReferenceTerm) function_name).identifier, function_name, - ((LexedValue>)args.value).val.build().reverse(), + ((LexedValue>)args.value).getVal().build().reverse(), currentLinesSupplier, rright, startCol, endCol); :} ; @@ -3510,9 +3510,9 @@ function_call_expr ::= provider_function_call_expr ::= non_lambda_exprs:provider_name LPAR:l RPAR:r {: - Supplier currentLinesSupplier = joinExprLines(new Line(provider_name), new Line(l.currentInputLine, lright), new Line(r.currentInputLine, rright)); + Supplier currentLinesSupplier = joinExprLines(new Line(provider_name), new Line(l.getCurrentInputLine(), lright), new Line(r.getCurrentInputLine(), rright)); int startCol = min(provider_name.startCol, lleft, rleft); - int endCol = max(provider_name.endCol, lleft + l.len, rleft + r.len); + int endCol = max(provider_name.endCol, lleft + l.getLen(), rleft + r.getLen()); if (provider_name instanceof IdentifierReferenceTerm) { // Here, we may actually need to do some more complex handling of generic functions or something like a user-defined-type constructor. RESULT = new ProviderFunctionCallExpr(((IdentifierReferenceTerm) provider_name).identifier, currentLinesSupplier, rright, startCol, endCol); @@ -3522,9 +3522,9 @@ provider_function_call_expr ::= :} | identifier:contract_name COLON_COLON:c identifier:provider_name LPAR:l RPAR:r {: - Supplier currentLinesSupplier = joinExprLines(new Line(contract_name), new Line(c.currentInputLine, cright), new Line(provider_name), new Line(l.currentInputLine, lright), new Line(r.currentInputLine, rright)); + Supplier currentLinesSupplier = joinExprLines(new Line(contract_name), new Line(c.getCurrentInputLine(), cright), new Line(provider_name), new Line(l.getCurrentInputLine(), lright), new Line(r.getCurrentInputLine(), rright)); int startCol = min(contract_name.startCol, cleft, provider_name.startCol, lleft, rleft); - int endCol = max(contract_name.endCol, cleft + c.len, provider_name.endCol, lleft + l.len, rleft + r.len); + int endCol = max(contract_name.endCol, cleft + c.getLen(), provider_name.endCol, lleft + l.getLen(), rleft + r.getLen()); RESULT = new ContractProviderFunctionCallExpr( contract_name.identifier, contract_name, @@ -3539,9 +3539,9 @@ consumer_function_call_stmt ::= {: if (consumer_name instanceof IdentifierReferenceTerm) { // Here, we may actually need to do some more complex handling of generic functions or something like a user-defined-type constructor. - RESULT = new ConsumerFunctionCallStmt(((IdentifierReferenceTerm) consumer_name).identifier, ((LexedValue>)args.value).val.build().reverse()); + RESULT = new ConsumerFunctionCallStmt(((IdentifierReferenceTerm) consumer_name).identifier, ((LexedValue>)args.value).getVal().build().reverse()); } else { - RESULT = new FirstClassConsumerFunctionCallStmt(consumer_name, ((LexedValue>)args.value).val.build().reverse()); + RESULT = new FirstClassConsumerFunctionCallStmt(consumer_name, ((LexedValue>)args.value).getVal().build().reverse()); } :} | identifier:contract_name COLON_COLON identifier:consumer_name LPAR:l args_list:args RPAR:r SEMICOLON @@ -3551,7 +3551,7 @@ consumer_function_call_stmt ::= contract_name, ((IdentifierReferenceTerm) consumer_name).identifier, consumer_name, - ((LexedValue>)args.value).val.build().reverse()); + ((LexedValue>)args.value).getVal().build().reverse()); :} ; @@ -3585,9 +3585,9 @@ bool_arithmetic ::= :} | NOT:n expr:a {: - Supplier currentLinesSupplier = joinExprLines(new Line(n.currentInputLine, nright), new Line(a)); + Supplier currentLinesSupplier = joinExprLines(new Line(n.getCurrentInputLine(), nright), new Line(a)); int startCol = Math.min(nleft, a.startCol); - int endCol = Math.max(a.endCol, nleft + n.len); + int endCol = Math.max(a.endCol, nleft + n.getLen()); RESULT = new NotBoolExpr(a, currentLinesSupplier, a.currentLineNumber, startCol, endCol); :} ; @@ -3596,11 +3596,11 @@ instanceof_expr ::= expr:a INSTANCEOF:op builtin_type:b {: Supplier currentLinesSupplier = - joinExprLines(new Line(a.currentLine, a.currentLineNumber), new Line(op.currentInputLine, opright), new Line(((LexedValue) b.value).currentInputLine, b.right)); + joinExprLines(new Line(a.currentLine, a.currentLineNumber), new Line(op.getCurrentInputLine(), opright), new Line(((LexedValue) b.value).getCurrentInputLine(), b.right)); int startCol = min(a.startCol, opleft, b.left); - int endCol = max(a.endCol, opleft + op.len, b.left + ((LexedValue) b.value).len); + int endCol = max(a.endCol, opleft + op.getLen(), b.left + ((LexedValue) b.value).getLen()); - RESULT = new InstanceofBoolExpr(a, ((LexedValue) b.value).val, currentLinesSupplier, bright, startCol, endCol); + RESULT = new InstanceofBoolExpr(a, ((LexedValue) b.value).getVal(), currentLinesSupplier, bright, startCol, endCol); :} ; @@ -3608,19 +3608,19 @@ fmt_string ::= FMT_STRING_PART:fs expr:e fmt_string:fswt {: Supplier currentLinesSupplier = - joinExprLines(new Line(fs.currentInputLine, fsright), new Line(e.currentLine, e.currentLineNumber), new Line(((LexedValue) fswt.value).currentInputLine, fswt.right)); + joinExprLines(new Line(fs.getCurrentInputLine(), fsright), new Line(e.currentLine, e.currentLineNumber), new Line(((LexedValue) fswt.value).getCurrentInputLine(), fswt.right)); int startCol = min(fsleft, e.startCol, fswt.left); - int endCol = max(fsleft + fs.len, e.endCol, fswt.left + ((LexedValue) fswt.value).len); + int endCol = max(fsleft + fs.getLen(), e.endCol, fswt.left + ((LexedValue) fswt.value).getLen()); - ImmutableList fswtList = ((LexedValue>)fswt.value).val; - fswtList.get(0).add(fs.val); + ImmutableList fswtList = ((LexedValue>)fswt.value).getVal(); + fswtList.get(0).add(fs.getVal()); fswtList.get(1).add(e); RESULT = new Symbol( -1, startCol, fswt.right, // line number - new LexedValue( + LexedValue.create( fswtList, currentLinesSupplier, endCol - startCol) @@ -3629,16 +3629,16 @@ fmt_string ::= | FMT_STRING_PART:fs expr:e STRING:tail {: Supplier currentLinesSupplier = - joinExprLines(new Line(fs.currentInputLine, fsright), new Line(e.currentLine, e.currentLineNumber), new Line(tail.currentInputLine, tailright)); + joinExprLines(new Line(fs.getCurrentInputLine(), fsright), new Line(e.currentLine, e.currentLineNumber), new Line(tail.getCurrentInputLine(), tailright)); int startCol = min(fsleft, e.startCol, tailleft); - int endCol = max(fsleft + fs.len, e.endCol, tailleft + tail.len); + int endCol = max(fsleft + fs.getLen(), e.endCol, tailleft + tail.getLen()); RESULT = new Symbol( -1, startCol, tailright, // line number - new LexedValue( - ImmutableList.of(ImmutableList.builder().add(tail.val).add(fs.val), ImmutableList.builder().add(e)), + LexedValue.create( + ImmutableList.of(ImmutableList.builder().add(tail.getVal()).add(fs.getVal()), ImmutableList.builder().add(e)), currentLinesSupplier, endCol - startCol) ); @@ -3654,26 +3654,26 @@ http_endpoints_list ::= identifier:endpoint_name COLON fmt_string:path COMMA http_endpoints_list:tail {: LexedValue> fsLexedValue = (LexedValue>) path.value; - ImmutableList fs = fsLexedValue.val; - FormatStringExpr pathFmtStringExpr = new FormatStringExpr(fs.get(0).build().reverse(), fs.get(1).build().reverse(), fsLexedValue.currentInputLine, path.right, path.left, path.left + fsLexedValue.len); + ImmutableList fs = fsLexedValue.getVal(); + FormatStringExpr pathFmtStringExpr = new FormatStringExpr(fs.get(0).build().reverse(), fs.get(1).build().reverse(), fsLexedValue.getCurrentInputLine(), path.right, path.left, path.left + fsLexedValue.getLen()); RESULT = tail.put(endpoint_name, pathFmtStringExpr); :} | identifier:endpoint_name COLON STRING:path COMMA http_endpoints_list:tail {: - RESULT = tail.put(endpoint_name, path.val); + RESULT = tail.put(endpoint_name, path.getVal()); :} | identifier:endpoint_name COLON fmt_string:path {: LexedValue> fsLexedValue = (LexedValue>) path.value; - ImmutableList fs = fsLexedValue.val; - FormatStringExpr pathFmtStringExpr = new FormatStringExpr(fs.get(0).build().reverse(), fs.get(1).build().reverse(), fsLexedValue.currentInputLine, path.right, path.left, path.left + fsLexedValue.len); + ImmutableList fs = fsLexedValue.getVal(); + FormatStringExpr pathFmtStringExpr = new FormatStringExpr(fs.get(0).build().reverse(), fs.get(1).build().reverse(), fsLexedValue.getCurrentInputLine(), path.right, path.left, path.left + fsLexedValue.getLen()); RESULT = ImmutableMap.builder().put(endpoint_name, pathFmtStringExpr); :} | identifier:endpoint_name COLON STRING:path {: - RESULT = ImmutableMap.builder().put(endpoint_name, path.val); + RESULT = ImmutableMap.builder().put(endpoint_name, path.getVal()); :} ; @@ -3696,9 +3696,9 @@ endpoint_handler_impl_graphs_list ::= get_http_client_expr ::= GET_HTTP_CLIENT:g LPAR:l expr:base_url RPAR:r {: - Supplier currentLinesSupplier = joinExprLines(new Line(g.currentInputLine, gright), new Line(l.currentInputLine, lright), new Line(base_url), new Line(r.currentInputLine, rright)); + Supplier currentLinesSupplier = joinExprLines(new Line(g.getCurrentInputLine(), gright), new Line(l.getCurrentInputLine(), lright), new Line(base_url), new Line(r.getCurrentInputLine(), rright)); int startCol = min(gleft, lleft, base_url.startCol, rleft); - int endCol = max(gleft + g.len, lleft + l.len, base_url.endCol, rleft + r.len); + int endCol = max(gleft + g.getLen(), lleft + l.getLen(), base_url.endCol, rleft + r.getLen()); RESULT = new GetHttpClientExpr(base_url, currentLinesSupplier, rright, startCol, endCol); :} ; @@ -3706,16 +3706,16 @@ get_http_client_expr ::= get_basic_http_server_for_port_expr ::= GET_BASIC_HTTP_SERVER_FOR_PORT:g LPAR:l expr:port RPAR:r {: - Supplier currentLinesSupplier = joinExprLines(new Line(g.currentInputLine, gright), new Line(l.currentInputLine, lright), new Line(port), new Line(r.currentInputLine, rright)); + Supplier currentLinesSupplier = joinExprLines(new Line(g.getCurrentInputLine(), gright), new Line(l.getCurrentInputLine(), lright), new Line(port), new Line(r.getCurrentInputLine(), rright)); int startCol = min(gleft, lleft, port.startCol, rleft); - int endCol = max(gleft + g.len, lleft + l.len, port.endCol, rleft + r.len); + int endCol = max(gleft + g.getLen(), lleft + l.getLen(), port.endCol, rleft + r.getLen()); RESULT = new GetHttpServerExpr(port, currentLinesSupplier, rright, startCol, endCol); :} ; privileged_inline_java ::= PRIVILEGED_INLINE_JAVA:java - {: RESULT = new PrivilegedInlineJavaStmt(java.currentInputLine.get()); :} + {: RESULT = new PrivilegedInlineJavaStmt(java.getCurrentInputLine().get()); :} ; // The last production 'term' closes the grammar. It's a primitive or identifier reference. @@ -3730,17 +3730,17 @@ term ::= {: RESULT = new PipeChainBackreferenceTerm( - a.currentInputLine, + a.getCurrentInputLine(), aright, aleft, - aleft + a.len + aleft + a.getLen() ); :} ; identifier ::= IDENTIFIER:identifier - {: RESULT = new IdentifierReferenceTerm(identifier.val, identifier.currentInputLine, identifierright, identifierleft, identifierleft + identifier.len); :} + {: RESULT = new IdentifierReferenceTerm(identifier.getVal(), identifier.getCurrentInputLine(), identifierright, identifierleft, identifierleft + identifier.getLen()); :} ; primitive ::= @@ -3749,19 +3749,19 @@ primitive ::= | integer:i {: RESULT = i; :} | STRING:s - {: RESULT = new StringTerm(s.val, s.currentInputLine, sright, sleft, sleft + s.len); :} + {: RESULT = new StringTerm(s.getVal(), s.getCurrentInputLine(), sright, sleft, sleft + s.getLen()); :} | TRUE:t - {: RESULT = new TrueTerm(t.currentInputLine, tright, tleft, tleft + t.len); :} + {: RESULT = new TrueTerm(t.getCurrentInputLine(), tright, tleft, tleft + t.getLen()); :} | FALSE:f - {: RESULT = new FalseTerm(f.currentInputLine, fright, fleft, fleft + f.len); :} + {: RESULT = new FalseTerm(f.getCurrentInputLine(), fright, fleft, fleft + f.getLen()); :} ; float ::= FLOAT:f - {: RESULT = new FloatTerm(f.val, f.currentInputLine, fright, fleft, fleft + f.len); :} + {: RESULT = new FloatTerm(f.getVal(), f.getCurrentInputLine(), fright, fleft, fleft + f.getLen()); :} ; integer ::= INTEGER:i - {: RESULT = new IntegerTerm(i.val, i.currentInputLine, iright, ileft, ileft + i.len); :} + {: RESULT = new IntegerTerm(i.getVal(), i.getCurrentInputLine(), iright, ileft, ileft + i.getLen()); :} ; diff --git a/src/java/com/claro/LexedValue.java b/src/java/com/claro/LexedValue.java index 7a3f618b..d57dc5c6 100644 --- a/src/java/com/claro/LexedValue.java +++ b/src/java/com/claro/LexedValue.java @@ -1,14 +1,18 @@ package com.claro; -import lombok.AllArgsConstructor; -import lombok.Data; +import com.google.auto.value.AutoValue; import java.util.function.Supplier; -@Data -@AllArgsConstructor -public class LexedValue { - public final T val; - public final Supplier currentInputLine; - public final int len; +@AutoValue +public abstract class LexedValue { + public abstract T getVal(); + + public abstract Supplier getCurrentInputLine(); + + public abstract int getLen(); + + public static LexedValue create(T val, Supplier currentInputLine, int len) { + return new AutoValue_LexedValue<>(val, currentInputLine, len); + } } diff --git a/src/java/com/claro/claro_build_rules.bzl b/src/java/com/claro/claro_build_rules.bzl index 0c787d45..b7c30a1b 100644 --- a/src/java/com/claro/claro_build_rules.bzl +++ b/src/java/com/claro/claro_build_rules.bzl @@ -106,7 +106,7 @@ def claro_library(name, src, module_api_file = None, java_name = None, claro_com DEFAULT_PACKAGE_PREFIX, # --package # Here, construct a totally unique name for this particular module. Since we're using Bazel, I have the # guarantee that this RULEDIR+target name is globally unique across the entire project. - "--unique_module_name=$$(echo $(RULEDIR) | cut -c $$(($$(echo $(GENDIR) | wc -c ) - 1))- | tr '/' '$$')\$$" + name if isModule else "" + "--unique_module_name=$$(echo $(RULEDIR) | cut -c $$(($$(echo $(GENDIR) | wc -c ) - 1))- | tr '/' '$$')\\$$" + name if isModule else "" ), toolchains = ["@bazel_tools//tools/jdk:current_java_runtime"], # Gives the above cmd access to $(JAVA). tools = [ @@ -199,6 +199,6 @@ def gen_claro_compiler(name = DEFAULT_CLARO_NAME): name = "lexed_value", srcs = ["LexedValue.java"], deps = [ - "//:lombok", + "//:autovalue", ], ) diff --git a/src/java/com/claro/intermediate_representation/statements/ConsumerFunctionDefinitionStmt.java b/src/java/com/claro/intermediate_representation/statements/ConsumerFunctionDefinitionStmt.java index 9878224b..0eb0608f 100644 --- a/src/java/com/claro/intermediate_representation/statements/ConsumerFunctionDefinitionStmt.java +++ b/src/java/com/claro/intermediate_representation/statements/ConsumerFunctionDefinitionStmt.java @@ -48,7 +48,8 @@ public ConsumerFunctionDefinitionStmt( injectedKeysTypes.stream() .map( injectedKey -> - new Key(injectedKey.name, injectedKey.typeProvider.resolveType(scopedHeap))) + new Key(injectedKey.getName(), injectedKey.getTypeProvider() + .resolveType(scopedHeap))) .collect(Collectors.toSet()) ) .orElse(Sets.newHashSet()), diff --git a/src/java/com/claro/intermediate_representation/statements/FunctionDefinitionStmt.java b/src/java/com/claro/intermediate_representation/statements/FunctionDefinitionStmt.java index e726e45c..ac8fa1d0 100644 --- a/src/java/com/claro/intermediate_representation/statements/FunctionDefinitionStmt.java +++ b/src/java/com/claro/intermediate_representation/statements/FunctionDefinitionStmt.java @@ -79,7 +79,8 @@ public FunctionDefinitionStmt( injectedKeysTypes.stream() .map( injectedKey -> - new Key(injectedKey.name, injectedKey.typeProvider.resolveType(scopedHeap))) + new Key(injectedKey.getName(), injectedKey.getTypeProvider() + .resolveType(scopedHeap))) .collect(Collectors.toSet()) ) .orElse(Sets.newHashSet()), diff --git a/src/java/com/claro/intermediate_representation/statements/GenericFunctionDefinitionStmt.java b/src/java/com/claro/intermediate_representation/statements/GenericFunctionDefinitionStmt.java index 804cbd28..ed1bb525 100644 --- a/src/java/com/claro/intermediate_representation/statements/GenericFunctionDefinitionStmt.java +++ b/src/java/com/claro/intermediate_representation/statements/GenericFunctionDefinitionStmt.java @@ -284,7 +284,8 @@ private ProcedureDefinitionStmt generateProcedureDefStmt(String canonicalProcedu injectedKeysTypes.stream() .map( injectedKey -> - new Key(injectedKey.name, injectedKey.typeProvider.resolveType(scopedHeap))) + new Key(injectedKey.getName(), injectedKey.getTypeProvider() + .resolveType(scopedHeap))) .collect(Collectors.toSet()) ) .orElse(Sets.newHashSet()), @@ -319,7 +320,8 @@ private ProcedureDefinitionStmt generateProcedureDefStmt(String canonicalProcedu injectedKeysTypes.stream() .map( injectedKey -> - new Key(injectedKey.name, injectedKey.typeProvider.resolveType(scopedHeap))) + new Key(injectedKey.getName(), injectedKey.getTypeProvider() + .resolveType(scopedHeap))) .collect(Collectors.toSet()) ) .orElse(Sets.newHashSet()), @@ -355,7 +357,8 @@ private ProcedureDefinitionStmt generateProcedureDefStmt(String canonicalProcedu injectedKeysTypes.stream() .map( injectedKey -> - new Key(injectedKey.name, injectedKey.typeProvider.resolveType(scopedHeap))) + new Key(injectedKey.getName(), injectedKey.getTypeProvider() + .resolveType(scopedHeap))) .collect(Collectors.toSet()) ) .orElse(Sets.newHashSet()), diff --git a/src/java/com/claro/intermediate_representation/statements/ProcedureDefinitionStmt.java b/src/java/com/claro/intermediate_representation/statements/ProcedureDefinitionStmt.java index 48e34246..a2a34bb2 100644 --- a/src/java/com/claro/intermediate_representation/statements/ProcedureDefinitionStmt.java +++ b/src/java/com/claro/intermediate_representation/statements/ProcedureDefinitionStmt.java @@ -140,8 +140,8 @@ public void registerProcedureTypeProvider(ScopedHeap scopedHeap) { .collect( ImmutableMap.toImmutableMap( injectedKey -> - new Key(injectedKey.name, injectedKey.typeProvider.resolveType(scopedHeap)), - injectedKey -> injectedKey.optionalAlias + new Key(injectedKey.getName(), injectedKey.getTypeProvider().resolveType(scopedHeap)), + injectedKey -> injectedKey.getOptionalAlias() ))); // Validate that this is not a redeclaration of an identifier. diff --git a/src/java/com/claro/intermediate_representation/statements/ProviderFunctionDefinitionStmt.java b/src/java/com/claro/intermediate_representation/statements/ProviderFunctionDefinitionStmt.java index eae84774..9fa49a0c 100644 --- a/src/java/com/claro/intermediate_representation/statements/ProviderFunctionDefinitionStmt.java +++ b/src/java/com/claro/intermediate_representation/statements/ProviderFunctionDefinitionStmt.java @@ -41,7 +41,8 @@ public ProviderFunctionDefinitionStmt( injectedKeysTypes.stream() .map( injectedKey -> - new Key(injectedKey.name, injectedKey.typeProvider.resolveType(scopedHeap))) + new Key(injectedKey.getName(), injectedKey.getTypeProvider() + .resolveType(scopedHeap))) .collect(Collectors.toSet()) ) .orElse(Sets.newHashSet()), diff --git a/src/java/com/claro/module_system/ModuleApiLexer.flex b/src/java/com/claro/module_system/ModuleApiLexer.flex index 85544fff..d7697a58 100644 --- a/src/java/com/claro/module_system/ModuleApiLexer.flex +++ b/src/java/com/claro/module_system/ModuleApiLexer.flex @@ -44,7 +44,7 @@ import java.util.concurrent.atomic.AtomicReference; private Symbol symbol(int type, int lines, int columns, T value) { addToLine(value); final StringBuilder currentInputLineBuilder = currentInputLine.get(); - Symbol res = new Symbol(type, yycolumn, yyline, new LexedValue(value, () -> currentInputLineBuilder.toString(), columns)); + Symbol res = new Symbol(type, yycolumn, yyline, LexedValue.create(value, () -> currentInputLineBuilder.toString(), columns)); yyline += lines; yycolumn += columns; return res; diff --git a/src/java/com/claro/module_system/ModuleApiParser.cup b/src/java/com/claro/module_system/ModuleApiParser.cup index a5266404..5e8aedf8 100644 --- a/src/java/com/claro/module_system/ModuleApiParser.cup +++ b/src/java/com/claro/module_system/ModuleApiParser.cup @@ -25,15 +25,15 @@ action code {: private Symbol constructBuiltinType(LexedValue lb, int lbleft, int lbright, Symbol t, LexedValue rb, int rbleft, int rbright, Function, TypeProvider> typeProviderConstructor) { LexedValue tLexedVal = (LexedValue) t.value; Supplier currentLinesSupplier = - joinExprLines(new Line(lb.currentInputLine, lbright), new Line(tLexedVal.currentInputLine, t.right), new Line(rb.currentInputLine, rbright)); + joinExprLines(new Line(lb.getCurrentInputLine(), lbright), new Line(tLexedVal.getCurrentInputLine(), t.right), new Line(rb.getCurrentInputLine(), rbright)); int startCol = min(lbleft, t.left, rbleft); - int endCol = max(lbleft + lb.len, t.left + tLexedVal.len, rbleft + rb.len); + int endCol = max(lbleft + lb.getLen(), t.left + tLexedVal.getLen(), rbleft + rb.getLen()); return new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( typeProviderConstructor.apply(tLexedVal), currentLinesSupplier, endCol - startCol) @@ -61,14 +61,14 @@ parser code {: return; } System.err.print(String.format("%s.claro_module_api:%s: ", generatedClassName, currSymbol.right + 1)); - System.err.println("Unexpected token <" + lexedValue.val + ">"); - String currentInputLineString = lexedValue.currentInputLine.get(); + System.err.println("Unexpected token <" + lexedValue.getVal() + ">"); + String currentInputLineString = lexedValue.getCurrentInputLine().get(); if (Character.isWhitespace(currentInputLineString.charAt(currentInputLineString.length() - 1))) { int trailingWhitespaceStart = currentInputLineString.length(); while (Character.isWhitespace(currentInputLineString.charAt(--trailingWhitespaceStart))); // This is just cute for the sake of it....barf...but I'm keeping it lol. System.err.println(currentInputLineString.substring(0, trailingWhitespaceStart + 1)); } else { - System.err.println(lexedValue.currentInputLine.get()); + System.err.println(lexedValue.getCurrentInputLine().get()); } System.err.println(Strings.repeat(" ", currSymbol.left) + '^'); }); @@ -89,7 +89,7 @@ parser code {: } Line(Symbol s) { - this(((LexedValue)s.value).currentInputLine, s.right); + this(((LexedValue)s.value).getCurrentInputLine(), s.right); } Line(Supplier inputLineSupplier, int inputLineNumber) { @@ -188,9 +188,9 @@ builtin_type ::= | MUT:m base_builtin_type_without_mutability_modifier:base_type {: RESULT = constructBuiltinType( - m, mleft, mright, base_type, new LexedValue("", () -> "", 0), base_type.left + ((LexedValue) base_type.value).len, base_type.right, + m, mleft, mright, base_type, LexedValue.create("", () -> "", 0), base_type.left + ((LexedValue) base_type.value).getLen(), base_type.right, tLexedVal -> (TypeProvider) (scopedHeap) -> { - Type resolvedType = tLexedVal.val.resolveType(scopedHeap); + Type resolvedType = tLexedVal.getVal().resolveType(scopedHeap); // Literally all I need to do is manually mark the thing mutable if mutability is supported for this type. if (resolvedType instanceof SupportsMutableVariant) { return ((SupportsMutableVariant) resolvedType).toShallowlyMutableVariant(); @@ -211,10 +211,10 @@ base_builtin_type_without_mutability_modifier ::= -1, tleft, tright, // line number - new LexedValue( + LexedValue.create( (TypeProvider) ImmediateTypeProvider.of(Types.INTEGER), - t.currentInputLine, - t.len) + t.getCurrentInputLine(), + t.getLen()) ); :} | FLOAT_TYPE:t @@ -223,10 +223,10 @@ base_builtin_type_without_mutability_modifier ::= -1, tleft, tright, // line number - new LexedValue( + LexedValue.create( (TypeProvider) ImmediateTypeProvider.of(Types.FLOAT), - t.currentInputLine, - t.len) + t.getCurrentInputLine(), + t.getLen()) ); :} | BOOLEAN_TYPE:t @@ -235,10 +235,10 @@ base_builtin_type_without_mutability_modifier ::= -1, tleft, tright, // line number - new LexedValue( + LexedValue.create( (TypeProvider) ImmediateTypeProvider.of(Types.BOOLEAN), - t.currentInputLine, - t.len) + t.getCurrentInputLine(), + t.getLen()) ); :} | STRING_TYPE:t @@ -247,10 +247,10 @@ base_builtin_type_without_mutability_modifier ::= -1, tleft, tright, // line number - new LexedValue( + LexedValue.create( (TypeProvider) ImmediateTypeProvider.of(Types.STRING), - t.currentInputLine, - t.len) + t.getCurrentInputLine(), + t.getLen()) ); :} | LBRACKET:lb builtin_type:t RBRACKET:rb @@ -260,7 +260,7 @@ base_builtin_type_without_mutability_modifier ::= tLexedVal -> (TypeProvider) (scopedHeap) -> { boolean impossibleRecursionAlreadyFoundOnLevel = scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND"); - Type resolvedType = Types.ListType.forValueType(tLexedVal.val.resolveType(scopedHeap)); + Type resolvedType = Types.ListType.forValueType(tLexedVal.getVal().resolveType(scopedHeap)); // Recursive aliases are allowed to be defined within this type since it has an implicit "bottom". But // it doesn't matter if we've already found impossible, unresolved recursion on this level. if (!impossibleRecursionAlreadyFoundOnLevel && scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND")) { @@ -276,7 +276,7 @@ base_builtin_type_without_mutability_modifier ::= tLexedVal -> (TypeProvider) (scopedHeap) -> { boolean impossibleRecursionAlreadyFoundOnLevel = scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND"); - Type resolvedType = Types.SetType.forValueType(tLexedVal.val.resolveType(scopedHeap)); + Type resolvedType = Types.SetType.forValueType(tLexedVal.getVal().resolveType(scopedHeap)); // Recursive aliases are allowed to be defined within this type since it has an implicit "bottom". But // it doesn't matter if we've already found impossible, unresolved recursion on this level. if (!impossibleRecursionAlreadyFoundOnLevel && scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND")) { @@ -292,19 +292,19 @@ base_builtin_type_without_mutability_modifier ::= LexedValue keyLexedVal = (LexedValue) key.value; LexedValue valueLexedVal = (LexedValue) value.value; Supplier currentLinesSupplier = - joinExprLines(new Line(la.currentInputLine, laright), new Line(keyLexedVal.currentInputLine, key.right), new Line(c.currentInputLine, cright), new Line(valueLexedVal.currentInputLine, value.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(la.getCurrentInputLine(), laright), new Line(keyLexedVal.getCurrentInputLine(), key.right), new Line(c.getCurrentInputLine(), cright), new Line(valueLexedVal.getCurrentInputLine(), value.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(laleft, key.left, cleft, value.left, raleft); - int endCol = max(laleft + la.len, key.left + keyLexedVal.len, cleft + c.len, value.left + valueLexedVal.len, raleft + ra.len); + int endCol = max(laleft + la.getLen(), key.left + keyLexedVal.getLen(), cleft + c.getLen(), value.left + valueLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( (TypeProvider) (scopedHeap) -> { boolean impossibleRecursionAlreadyFoundOnLevel = scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND"); - Type resolvedType = Types.MapType.forKeyValueTypes(keyLexedVal.val.resolveType(scopedHeap), valueLexedVal.val.resolveType(scopedHeap)); + Type resolvedType = Types.MapType.forKeyValueTypes(keyLexedVal.getVal().resolveType(scopedHeap), valueLexedVal.getVal().resolveType(scopedHeap)); // Recursive aliases are allowed to be defined within this type since it has an implicit "bottom". But // it doesn't matter if we've already found impossible, unresolved recursion on this level. if (!impossibleRecursionAlreadyFoundOnLevel && scopedHeap.isIdentifierDeclared("$POTENTIAL_IMPOSSIBLE_SELF_REFERENCING_TYPE_FOUND")) { @@ -320,16 +320,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg_types.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg_types.left + argTypesLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg_types.left + argTypesLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.OneofType.forVariantTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList())), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.OneofType.forVariantTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList())), currentLinesSupplier, endCol - startCol) ); @@ -339,16 +339,16 @@ base_builtin_type_without_mutability_modifier ::= LexedValue argLexedVal = (LexedValue) arg.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argLexedVal.currentInputLine, arg.right), new Line(a.currentInputLine, aright), new Line(outputTypeLexedVal.currentInputLine, output_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argLexedVal.getCurrentInputLine(), arg.right), new Line(a.getCurrentInputLine(), aright), new Line(outputTypeLexedVal.getCurrentInputLine(), output_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg.left, aleft, output_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg.left + argLexedVal.len, aleft + a.len, output_type.left + outputTypeLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg.left + argLexedVal.getLen(), aleft + a.getLen(), output_type.left + outputTypeLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.val.resolveType(scopedHeap)), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.getVal().resolveType(scopedHeap)), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), currentLinesSupplier, endCol - startCol) ); @@ -358,16 +358,16 @@ base_builtin_type_without_mutability_modifier ::= LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(b1.currentInputLine, b1right), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(b2.currentInputLine, b2right), new Line(a.currentInputLine, aright), new Line(outputTypeLexedVal.currentInputLine, output_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(b1.getCurrentInputLine(), b1right), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(b2.getCurrentInputLine(), b2right), new Line(a.getCurrentInputLine(), aright), new Line(outputTypeLexedVal.getCurrentInputLine(), output_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, b1left, arg_types.left, b2left, aleft, output_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, b1left + b1.len, arg_types.left + argTypesLexedVal.len, b2left + b2.len, aleft + a.len, output_type.left + outputTypeLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), b1left + b1.getLen(), arg_types.left + argTypesLexedVal.getLen(), b2left + b2.getLen(), aleft + a.getLen(), output_type.left + outputTypeLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), currentLinesSupplier, endCol - startCol) ); @@ -377,16 +377,16 @@ base_builtin_type_without_mutability_modifier ::= LexedValue argLexedVal = (LexedValue) arg.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argLexedVal.currentInputLine, arg.right), new Line(a.currentInputLine, aright), new Line(outputTypeLexedVal.currentInputLine, output_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argLexedVal.getCurrentInputLine(), arg.right), new Line(a.getCurrentInputLine(), aright), new Line(outputTypeLexedVal.getCurrentInputLine(), output_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg.left, aleft, output_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg.left + argLexedVal.len, aleft + a.len, output_type.left + outputTypeLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg.left + argLexedVal.getLen(), aleft + a.getLen(), output_type.left + outputTypeLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.val.resolveType(scopedHeap)), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.getVal().resolveType(scopedHeap)), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), currentLinesSupplier, endCol - startCol) ); @@ -396,16 +396,16 @@ base_builtin_type_without_mutability_modifier ::= LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(b1.currentInputLine, b1right), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(b2.currentInputLine, b2right), new Line(a.currentInputLine, aright), new Line(outputTypeLexedVal.currentInputLine, output_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(b1.getCurrentInputLine(), b1right), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(b2.getCurrentInputLine(), b2right), new Line(a.getCurrentInputLine(), aright), new Line(outputTypeLexedVal.getCurrentInputLine(), output_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, b1left, arg_types.left, b2left, aleft, output_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, b1left + b1.len, arg_types.left + argTypesLexedVal.len, b2left + b2.len, aleft + a.len, output_type.left + outputTypeLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), b1left + b1.getLen(), arg_types.left + argTypesLexedVal.getLen(), b2left + b2.getLen(), aleft + a.getLen(), output_type.left + outputTypeLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), currentLinesSupplier, endCol - startCol) ); @@ -414,16 +414,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg_types.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg_types.left + argTypesLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg_types.left + argTypesLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/false), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/false), currentLinesSupplier, endCol - startCol) ); @@ -432,16 +432,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg_types.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg_types.left + argTypesLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg_types.left + argTypesLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/true), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/true), currentLinesSupplier, endCol - startCol) ); @@ -450,16 +450,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue returnTypeProvider = (LexedValue) return_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(returnTypeProvider.currentInputLine, return_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(returnTypeProvider.getCurrentInputLine(), return_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, return_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, return_type.left + returnTypeProvider.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), return_type.left + returnTypeProvider.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(returnTypeProvider.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(returnTypeProvider.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/false), currentLinesSupplier, endCol - startCol) ); @@ -468,16 +468,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue returnTypeProvider = (LexedValue) return_type.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(returnTypeProvider.currentInputLine, return_type.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(returnTypeProvider.getCurrentInputLine(), return_type.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, return_type.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, return_type.left + returnTypeProvider.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), return_type.left + returnTypeProvider.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(returnTypeProvider.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(returnTypeProvider.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/true), currentLinesSupplier, endCol - startCol) ); @@ -486,16 +486,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; Supplier currentLinesSupplier = - joinExprLines(new Line(t.currentInputLine, tright), new Line(la.currentInputLine, laright), new Line(argTypesLexedVal.currentInputLine, arg_types.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(t.getCurrentInputLine(), tright), new Line(la.getCurrentInputLine(), laright), new Line(argTypesLexedVal.getCurrentInputLine(), arg_types.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(tleft, laleft, arg_types.left, raleft); - int endCol = max(tleft + t.len, laleft + la.len, arg_types.left + argTypesLexedVal.len, raleft + ra.len); + int endCol = max(tleft + t.getLen(), laleft + la.getLen(), arg_types.left + argTypesLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.TupleType.forValueTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList())), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.TupleType.forValueTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList())), currentLinesSupplier, endCol - startCol) ); @@ -504,16 +504,16 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue wrappedTypeProvider = (LexedValue) wrapped.value; Supplier currentLinesSupplier = - joinExprLines(new Line(f.currentInputLine, fright), new Line(la.currentInputLine, laright), new Line(wrappedTypeProvider.currentInputLine, wrapped.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(f.getCurrentInputLine(), fright), new Line(la.getCurrentInputLine(), laright), new Line(wrappedTypeProvider.getCurrentInputLine(), wrapped.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(fleft, laleft, wrapped.left, raleft); - int endCol = max(fleft + f.len, laleft + la.len, wrapped.left + wrappedTypeProvider.len, raleft + ra.len); + int endCol = max(fleft + f.getLen(), laleft + la.getLen(), wrapped.left + wrappedTypeProvider.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( - (TypeProvider) (scopedHeap) -> Types.FutureType.wrapping(wrappedTypeProvider.val.resolveType(scopedHeap)), + LexedValue.create( + (TypeProvider) (scopedHeap) -> Types.FutureType.wrapping(wrappedTypeProvider.getVal().resolveType(scopedHeap)), currentLinesSupplier, endCol - startCol) ); @@ -524,28 +524,28 @@ base_builtin_type_without_mutability_modifier ::= -1, type_nameleft, type_nameright, // line number - new LexedValue( - TypeProvider.Util.getTypeByName(type_name.val, /*isTypeDefinition=*/true), - type_name.currentInputLine, - type_name.len) + LexedValue.create( + TypeProvider.Util.getTypeByName(type_name.getVal(), /*isTypeDefinition=*/true), + type_name.getCurrentInputLine(), + type_name.getLen()) ); :} | IDENTIFIER:type_name L_ANGLE_BRACKET:la builtin_types_list:concrete_type_params R_ANGLE_BRACKET:ra {: LexedValue> concreteTypeParamsLexedVal = (LexedValue>) concrete_type_params.value; Supplier currentLinesSupplier = - joinExprLines(new Line(type_name.currentInputLine, type_nameright), new Line(la.currentInputLine, laright), new Line(concreteTypeParamsLexedVal.currentInputLine, concrete_type_params.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(type_name.getCurrentInputLine(), type_nameright), new Line(la.getCurrentInputLine(), laright), new Line(concreteTypeParamsLexedVal.getCurrentInputLine(), concrete_type_params.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(type_nameleft, laleft, concrete_type_params.left, raleft); - int endCol = max(type_nameleft + type_name.len, laleft + la.len, concrete_type_params.left + concreteTypeParamsLexedVal.len, raleft + ra.len); + int endCol = max(type_nameleft + type_name.getLen(), laleft + la.getLen(), concrete_type_params.left + concreteTypeParamsLexedVal.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( (TypeProvider) (scopedHeap) -> Types.UserDefinedType.forTypeNameAndParameterizedTypes( - type_name.val, - concreteTypeParamsLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()) + type_name.getVal(), + concreteTypeParamsLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()) ), currentLinesSupplier, endCol - startCol) @@ -557,19 +557,19 @@ base_builtin_type_without_mutability_modifier ::= // in turn is intended to resemble a sequence of variable initializations. I appreciate the metaphore of a struct as // a bundle of variables. {: - ImmutableList> fieldTypesList = ((LexedValue>) fields.value).val.build().entrySet().asList().reverse(); + ImmutableList> fieldTypesList = ((LexedValue>) fields.value).getVal().build().entrySet().asList().reverse(); ImmutableMap fieldTypesMap = ImmutableMap.builderWithExpectedSize(fieldTypesList.size()).putAll(fieldTypesList).build(); Supplier currentLinesSupplier = - joinExprLines(new Line(s.currentInputLine, sright), new Line(la.currentInputLine, laright), new Line(((LexedValue) fields.value).currentInputLine, fields.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(s.getCurrentInputLine(), sright), new Line(la.getCurrentInputLine(), laright), new Line(((LexedValue) fields.value).getCurrentInputLine(), fields.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(sleft, laleft, fields.left, raleft); - int endCol = max(sleft + s.len, laleft + la.len, fields.left + ((LexedValue) fields.value).len, raleft + ra.len); + int endCol = max(sleft + s.getLen(), laleft + la.getLen(), fields.left + ((LexedValue) fields.value).getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( (TypeProvider) (scopedHeap) -> Types.StructType.forFieldTypes( fieldTypesMap.keySet().asList(), @@ -586,19 +586,19 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue httpServiceLex = (LexedValue)http_service.value; Supplier currentLinesSupplier = - joinExprLines(new Line(h.currentInputLine, hright), new Line(la.currentInputLine, laright), new Line(httpServiceLex.currentInputLine, http_serviceright), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(h.getCurrentInputLine(), hright), new Line(la.getCurrentInputLine(), laright), new Line(httpServiceLex.getCurrentInputLine(), http_serviceright), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(hleft, laleft, http_serviceleft, raleft); - int endCol = max(hleft + h.len, laleft + la.len, http_serviceleft + httpServiceLex.len, raleft + ra.len); + int endCol = max(hleft + h.getLen(), laleft + la.getLen(), http_serviceleft + httpServiceLex.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( (TypeProvider) (scopedHeap) -> { // First things first, I need to actually do some type validation that this type has been correctly // parameterized with an HttpService and not some arbitrary type. - Type resolvedHttpServiceType = httpServiceLex.val.resolveType(scopedHeap); + Type resolvedHttpServiceType = httpServiceLex.getVal().resolveType(scopedHeap); if (!resolvedHttpServiceType.baseType().equals(BaseType.HTTP_SERVICE)) { throw new RuntimeException( ClaroTypeException.forIllegalHttpClientTypeWithNonHttpServiceParameterizedType(resolvedHttpServiceType) @@ -614,17 +614,17 @@ base_builtin_type_without_mutability_modifier ::= {: LexedValue wrappedTypeProvider = (LexedValue) wrapped.value; Supplier currentLinesSupplier = - joinExprLines(new Line(f.currentInputLine, fright), new Line(la.currentInputLine, laright), new Line(wrappedTypeProvider.currentInputLine, wrapped.right), new Line(ra.currentInputLine, raright)); + joinExprLines(new Line(f.getCurrentInputLine(), fright), new Line(la.getCurrentInputLine(), laright), new Line(wrappedTypeProvider.getCurrentInputLine(), wrapped.right), new Line(ra.getCurrentInputLine(), raright)); int startCol = min(fleft, laleft, wrapped.left, raleft); - int endCol = max(fleft + f.len, laleft + la.len, wrapped.left + wrappedTypeProvider.len, raleft + ra.len); + int endCol = max(fleft + f.getLen(), laleft + la.getLen(), wrapped.left + wrappedTypeProvider.getLen(), raleft + ra.getLen()); RESULT = new Symbol( -1, startCol, endCol, // line number - new LexedValue( + LexedValue.create( (TypeProvider) (scopedHeap) -> { - Type resolvedHttpServiceType = wrappedTypeProvider.val.resolveType(scopedHeap); + Type resolvedHttpServiceType = wrappedTypeProvider.getVal().resolveType(scopedHeap); if (!resolvedHttpServiceType.baseType().equals(BaseType.HTTP_SERVICE)) { throw new RuntimeException( ClaroTypeException.forIllegalHttpServerTypeWithNonHttpServiceParameterizedType(resolvedHttpServiceType) @@ -646,10 +646,10 @@ builtin_types_list ::= -1, b.left, b.right, // line number - new LexedValue( - bLexedValue.val.build().reverse(), - bLexedValue.currentInputLine, - bLexedValue.len) + LexedValue.create( + bLexedValue.getVal().build().reverse(), + bLexedValue.getCurrentInputLine(), + bLexedValue.getLen()) ); :} ; @@ -660,18 +660,18 @@ backwards_builtin_types_list ::= LexedValue tLexedVal = (LexedValue)t.value; LexedValue> tailLexedVal = (LexedValue>)tail.value; Supplier currentLinesSupplier = - joinExprLines(new Line(tLexedVal.currentInputLine, t.right), new Line(c.currentInputLine, cright), new Line(tailLexedVal.currentInputLine, tail.right)); + joinExprLines(new Line(tLexedVal.getCurrentInputLine(), t.right), new Line(c.getCurrentInputLine(), cright), new Line(tailLexedVal.getCurrentInputLine(), tail.right)); int startCol = min(t.left, cleft, tail.left); - int endCol = max(t.left + tLexedVal.len, cleft + c.len, tail.left + tailLexedVal.len); + int endCol = max(t.left + tLexedVal.getLen(), cleft + c.getLen(), tail.left + tailLexedVal.getLen()); RESULT = new Symbol( -1, startCol, tail.right, // line number - new LexedValue( - tailLexedVal.val.add(tLexedVal.val), + LexedValue.create( + tailLexedVal.getVal().add(tLexedVal.getVal()), currentLinesSupplier, - tailLexedVal.len) + tailLexedVal.getLen()) ); :} | builtin_type:t @@ -680,10 +680,10 @@ backwards_builtin_types_list ::= -1, t.left, t.right, // line number - new LexedValue( - ImmutableList.builder().add(((LexedValue) t.value).val), - ((LexedValue)t.value).currentInputLine, - ((LexedValue)t.value).len) + LexedValue.create( + ImmutableList.builder().add(((LexedValue) t.value).getVal()), + ((LexedValue)t.value).getCurrentInputLine(), + ((LexedValue)t.value).getLen()) ); :} ; @@ -698,11 +698,11 @@ generic_blocking_on ::= identifier_bar_sep_list ::= IDENTIFIER:i BAR identifier_bar_sep_list:b {: - RESULT = b.add(i.val); + RESULT = b.add(i.getVal()); :} | IDENTIFIER:i {: - RESULT = ImmutableList.builder().add(i.val); + RESULT = ImmutableList.builder().add(i.getVal()); :} ; @@ -712,26 +712,26 @@ maybe_blocking_procedure_types ::= LexedValue argLexedVal = (LexedValue) arg.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; - RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.val.resolveType(scopedHeap)), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); + RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(ImmutableList.of(argLexedVal.getVal().resolveType(scopedHeap)), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); :} | MAYBE_BLOCKING FUNCTION_TYPE:t L_ANGLE_BRACKET:la BAR:b1 builtin_types_list:arg_types BAR:b2 ARROW:a builtin_type:output_type R_ANGLE_BRACKET:ra {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; LexedValue outputTypeLexedVal = (LexedValue) output_type.value; - RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); + RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.FunctionType.typeLiteralForArgsAndReturnTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); :} | MAYBE_BLOCKING CONSUMER_FUNCTION_TYPE:t L_ANGLE_BRACKET:la builtin_types_list:arg_types R_ANGLE_BRACKET:ra {: LexedValue> argTypesLexedVal = (LexedValue>) arg_types.value; - RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.val.stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/null); + RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.ConsumerType.typeLiteralForConsumerArgTypes(argTypesLexedVal.getVal().stream().map(tp -> tp.resolveType(scopedHeap)).collect(ImmutableList.toImmutableList()), /*explicitlyAnnotatedBlocking=*/null); :} | MAYBE_BLOCKING PROVIDER_FUNCTION_TYPE:p L_ANGLE_BRACKET:la builtin_type:output_type R_ANGLE_BRACKET:ra {: LexedValue outputTypeLexedVal = (LexedValue) output_type.value; - RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(outputTypeLexedVal.val.resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); + RESULT = (TypeProvider) (scopedHeap) -> Types.ProcedureType.ProviderType.typeLiteralForReturnType(outputTypeLexedVal.getVal().resolveType(scopedHeap), /*explicitlyAnnotatedBlocking=*/null); :} ; @@ -739,15 +739,15 @@ identifier_list ::= IDENTIFIER:arg_name COMMA:c identifier_list:tail {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentInputLine, arg_nameright), new Line(c.currentInputLine, cright), new Line(((LexedValue)tail.value).currentInputLine, tail.right)); + joinExprLines(new Line(arg_name.getCurrentInputLine(), arg_nameright), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue)tail.value).getCurrentInputLine(), tail.right)); int startCol = min(arg_nameleft, cleft); - int endCol = max(arg_nameleft + arg_name.len, cleft + c.len); + int endCol = max(arg_nameleft + arg_name.getLen(), cleft + c.getLen()); RESULT = new Symbol( -1, startCol, tail.right, // line number - new LexedValue( - ((LexedValue>)tail.value).val.add(arg_name.val), + LexedValue.create( + ((LexedValue>)tail.value).getVal().add(arg_name.getVal()), currentLinesSupplier, endCol - startCol) ); @@ -758,10 +758,10 @@ identifier_list ::= -1, arg_nameleft, arg_nameright, // line number - new LexedValue( - ImmutableList.builder().add(arg_name.val), - arg_name.currentInputLine, - arg_name.len) + LexedValue.create( + ImmutableList.builder().add(arg_name.getVal()), + arg_name.getCurrentInputLine(), + arg_name.getLen()) ); :} ; @@ -772,16 +772,16 @@ function_args_types_list ::= IDENTIFIER:arg_name COLON:colon builtin_type:t COMMA:comma function_args_types_list:tail {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentInputLine, arg_nameright), new Line(colon.currentInputLine, colonright), new Line(((LexedValue) t.value).currentInputLine, t.right), new Line(comma.currentInputLine, commaright), new Line(((LexedValue) tail.value).currentInputLine, tail.right)); + joinExprLines(new Line(arg_name.getCurrentInputLine(), arg_nameright), new Line(colon.getCurrentInputLine(), colonright), new Line(((LexedValue) t.value).getCurrentInputLine(), t.right), new Line(comma.getCurrentInputLine(), commaright), new Line(((LexedValue) tail.value).getCurrentInputLine(), tail.right)); int startCol = min(arg_nameleft, colonleft, t.left, commaleft, tail.left); - int endCol = max(arg_nameleft + arg_name.len, colonleft + colon.len, t.left + ((LexedValue) t.value).len, commaleft + comma.len, tail.left + ((LexedValue) tail.value).len); + int endCol = max(arg_nameleft + arg_name.getLen(), colonleft + colon.getLen(), t.left + ((LexedValue) t.value).getLen(), commaleft + comma.getLen(), tail.left + ((LexedValue) tail.value).getLen()); RESULT = new Symbol( -1, startCol, t.right, // line number - new LexedValue( - ((LexedValue>) tail.value).val.put(arg_name.val, ((LexedValue) t.value).val), + LexedValue.create( + ((LexedValue>) tail.value).getVal().put(arg_name.getVal(), ((LexedValue) t.value).getVal()), currentLinesSupplier, endCol - startCol) ); @@ -789,16 +789,16 @@ function_args_types_list ::= | IDENTIFIER:arg_name COLON:c builtin_type:t {: Supplier currentLinesSupplier = - joinExprLines(new Line(arg_name.currentInputLine, arg_nameright), new Line(c.currentInputLine, cright), new Line(((LexedValue) t.value).currentInputLine, t.right)); + joinExprLines(new Line(arg_name.getCurrentInputLine(), arg_nameright), new Line(c.getCurrentInputLine(), cright), new Line(((LexedValue) t.value).getCurrentInputLine(), t.right)); int startCol = min(arg_nameleft, cleft, t.left); - int endCol = max(arg_nameleft + arg_name.len, cleft + c.len, t.left + ((LexedValue) t.value).len); + int endCol = max(arg_nameleft + arg_name.getLen(), cleft + c.getLen(), t.left + ((LexedValue) t.value).getLen()); RESULT = new Symbol( -1, startCol, t.right, // line number - new LexedValue( - ImmutableMap.builder().put(arg_name.val, ((LexedValue) t.value).val), + LexedValue.create( + ImmutableMap.builder().put(arg_name.getVal(), ((LexedValue) t.value).getVal()), currentLinesSupplier, endCol - startCol) ); @@ -808,19 +808,19 @@ function_args_types_list ::= procedure_args_w_generic_blocking ::= IDENTIFIER:arg_name COLON maybe_blocking_procedure_types:maybe_blocking_proc COMMA procedure_args_w_generic_blocking:args_w_generic_blocking {: - RESULT = args_w_generic_blocking.put(arg_name.val, maybe_blocking_proc); + RESULT = args_w_generic_blocking.put(arg_name.getVal(), maybe_blocking_proc); :} | IDENTIFIER:arg_name COLON builtin_type:t COMMA procedure_args_w_generic_blocking:args_w_generic_blocking {: - RESULT = args_w_generic_blocking.put(arg_name.val, ((LexedValue) t.value).val); + RESULT = args_w_generic_blocking.put(arg_name.getVal(), ((LexedValue) t.value).getVal()); :} | IDENTIFIER:arg_name COLON maybe_blocking_procedure_types:maybe_blocking_proc {: - RESULT = ImmutableMap.builder().put(arg_name.val, maybe_blocking_proc); + RESULT = ImmutableMap.builder().put(arg_name.getVal(), maybe_blocking_proc); :} | IDENTIFIER:arg_name COLON builtin_type:t {: - RESULT = ImmutableMap.builder().put(arg_name.val, ((LexedValue) t.value).val); + RESULT = ImmutableMap.builder().put(arg_name.getVal(), ((LexedValue) t.value).getVal()); :} ; @@ -839,89 +839,89 @@ contract_procedure_signature_definition_stmt ::= // FUNCTIONS FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} | BLOCKING FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} | generic_blocking_on:generic_blocking_on FUNCTION_TYPE IDENTIFIER:name LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), /*optionalGenericTypesList=*/ Optional.empty()); :} | FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR function_args_types_list:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), Optional.of(genericTypesList)); :} | BLOCKING FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.of(genericTypesList)); :} | generic_blocking_on:generic_blocking_on FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), Optional.of(genericTypesList)); :} // CONSUMERS | CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR SEMICOLON {: - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} | BLOCKING CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR function_args_types_list:backwards_arg_types RPAR SEMICOLON {: - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} | generic_blocking_on:generic_blocking_on CONSUMER_FUNCTION_TYPE IDENTIFIER:name LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR SEMICOLON {: ImmutableList> argTypesList = backwards_arg_types.build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), /*optionalGenericTypesList=*/ Optional.empty()); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), /*optionalGenericTypesList=*/ Optional.empty()); :} | CONSUMER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR function_args_types_list:backwards_arg_types RPAR SEMICOLON {: - ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).val.build().entrySet().asList().reverse(); + ImmutableList> argTypesList = ((LexedValue>) backwards_arg_types.value).getVal().build().entrySet().asList().reverse(); ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), Optional.of(genericTypesList)); :} | BLOCKING CONSUMER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR SEMICOLON {: @@ -929,8 +929,8 @@ contract_procedure_signature_definition_stmt ::= ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.of(genericTypesList)); :} | generic_blocking_on:generic_blocking_on CONSUMER_FUNCTION_TYPE IDENTIFIER:name L_ANGLE_BRACKET identifier_list:generic_types R_ANGLE_BRACKET LPAR procedure_args_w_generic_blocking:backwards_arg_types RPAR SEMICOLON {: @@ -938,19 +938,19 @@ contract_procedure_signature_definition_stmt ::= ImmutableMap argTypesMap = ImmutableMap.builderWithExpectedSize(argTypesList.size()).putAll(argTypesList).build(); ImmutableList genericTypesList = - ((LexedValue>)generic_types.value).val.build().reverse(); - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), Optional.of(genericTypesList)); + ((LexedValue>)generic_types.value).getVal().build().reverse(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.of(argTypesMap), Optional.empty(), /*explicitlyAnnotatedBlocking=*/null, /*genericBlockingOn=*/ Optional.of(generic_blocking_on), Optional.of(genericTypesList)); :} // PROVIDERS | PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.empty(), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.empty(), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/false, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} | BLOCKING PROVIDER_FUNCTION_TYPE IDENTIFIER:name LPAR RPAR ARROW builtin_type:output_type SEMICOLON {: - TypeProvider outputTypeProvider = ((LexedValue) output_type.value).val; - RESULT = new ContractProcedureSignatureDefinitionStmt(name.val, Optional.empty(), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); + TypeProvider outputTypeProvider = ((LexedValue) output_type.value).getVal(); + RESULT = new ContractProcedureSignatureDefinitionStmt(name.getVal(), Optional.empty(), Optional.of(outputTypeProvider), /*explicitlyAnnotatedBlocking=*/true, /*genericBlockingOn=*/ Optional.empty(), /*optionalGenericTypesList=*/ Optional.empty()); :} ; diff --git a/src/java/com/claro/runtime_utilities/injector/BUILD b/src/java/com/claro/runtime_utilities/injector/BUILD index 2ba09161..1502ca61 100644 --- a/src/java/com/claro/runtime_utilities/injector/BUILD +++ b/src/java/com/claro/runtime_utilities/injector/BUILD @@ -17,7 +17,7 @@ java_library( "//src/java/com/claro/intermediate_representation/statements:__pkg__", ], deps = [ - "//:lombok", + "//:autovalue", "//src/java/com/claro/intermediate_representation/types:type", "//src/java/com/claro/intermediate_representation/types:type_provider", ], diff --git a/src/java/com/claro/runtime_utilities/injector/InjectedKey.java b/src/java/com/claro/runtime_utilities/injector/InjectedKey.java index d4da627c..73d9b4d6 100644 --- a/src/java/com/claro/runtime_utilities/injector/InjectedKey.java +++ b/src/java/com/claro/runtime_utilities/injector/InjectedKey.java @@ -1,14 +1,20 @@ package com.claro.runtime_utilities.injector; import com.claro.intermediate_representation.types.TypeProvider; -import lombok.Value; +import com.google.auto.value.AutoValue; import java.util.Optional; // Internal representation of a potentially aliased key present in a using clause. -@Value -public class InjectedKey { - public String name; - public TypeProvider typeProvider; - public Optional optionalAlias; +@AutoValue +public abstract class InjectedKey { + public abstract String getName(); + + public abstract TypeProvider getTypeProvider(); + + public abstract Optional getOptionalAlias(); + + public static InjectedKey create(String name, TypeProvider typeProvider, Optional optionalAlias) { + return new AutoValue_InjectedKey(name, typeProvider, optionalAlias); + } } diff --git a/src/java/com/claro/runtime_utilities/injector/InjectedKeyIdentifier.java b/src/java/com/claro/runtime_utilities/injector/InjectedKeyIdentifier.java index bf8858ab..41fe56ea 100644 --- a/src/java/com/claro/runtime_utilities/injector/InjectedKeyIdentifier.java +++ b/src/java/com/claro/runtime_utilities/injector/InjectedKeyIdentifier.java @@ -17,6 +17,6 @@ public class InjectedKeyIdentifier { public Optional optionalAlias; public InjectedKey toInjectedKey() { - return new InjectedKey(name.getIdentifier(), typeProvider, optionalAlias); + return InjectedKey.create(name.getIdentifier(), typeProvider, optionalAlias); } }