11/*
2- * Copyright 2025 the original author or authors.
2+ * Copyright 2026 the original author or authors.
33 * <p>
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- // Generated from ~/git/rewrite/ rewrite-hcl/src/main/antlr/HCLParser.g4 by ANTLR 4.13.2
16+ // Generated from rewrite-hcl/src/main/antlr/HCLParser.g4 by ANTLR 4.13.2
1717package org .openrewrite .hcl .internal .grammar ;
1818import org .antlr .v4 .runtime .atn .*;
1919import org .antlr .v4 .runtime .dfa .DFA ;
@@ -32,63 +32,63 @@ public class HCLParser extends Parser {
3232 protected static final PredictionContextCache _sharedContextCache =
3333 new PredictionContextCache ();
3434 public static final int
35- FOR_BRACE =1 , FOR_BRACK =2 , IF =3 , IN =4 , BooleanLiteral =5 , NULL =6 , LBRACE =7 ,
36- RBRACE =8 , ASSIGN =9 , Identifier =10 , WS =11 , COMMENT =12 , LINE_COMMENT =13 ,
37- NEWLINE =14 , NumericLiteral =15 , QUOTE =16 , HEREDOC_START =17 , PLUS =18 , AND =19 ,
38- EQ =20 , LT =21 , DOUBLE_COLON =22 , COLON =23 , LBRACK =24 , LPAREN =25 , MINUS =26 ,
39- OR =27 , NEQ =28 , GT =29 , QUESTION =30 , RBRACK =31 , RPAREN =32 , MUL =33 , NOT =34 ,
40- LEQ =35 , DOT =36 , DIV =37 , GEQ =38 , ARROW =39 , COMMA =40 , MOD =41 , ELLIPSIS =42 ,
41- TILDE =43 , TEMPLATE_INTERPOLATION_START =44 , TemplateStringLiteral =45 , TemplateStringLiteralChar =46 ,
42- HP_WS =47 , HP_COMMENT =48 , HP_LINE_COMMENT =49 , HTemplateLiteral =50 , HTemplateLiteralChar =51 ,
35+ FOR_BRACE =1 , FOR_BRACK =2 , IF =3 , IN =4 , BooleanLiteral =5 , NULL =6 , LBRACE =7 ,
36+ RBRACE =8 , ASSIGN =9 , Identifier =10 , WS =11 , COMMENT =12 , LINE_COMMENT =13 ,
37+ NEWLINE =14 , NumericLiteral =15 , QUOTE =16 , HEREDOC_START =17 , PLUS =18 , AND =19 ,
38+ EQ =20 , LT =21 , DOUBLE_COLON =22 , COLON =23 , LBRACK =24 , LPAREN =25 , MINUS =26 ,
39+ OR =27 , NEQ =28 , GT =29 , QUESTION =30 , RBRACK =31 , RPAREN =32 , MUL =33 , NOT =34 ,
40+ LEQ =35 , DOT =36 , DIV =37 , GEQ =38 , ARROW =39 , COMMA =40 , MOD =41 , ELLIPSIS =42 ,
41+ TILDE =43 , TEMPLATE_INTERPOLATION_START =44 , TemplateStringLiteral =45 , TemplateStringLiteralChar =46 ,
42+ HP_WS =47 , HP_COMMENT =48 , HP_LINE_COMMENT =49 , HTemplateLiteral =50 , HTemplateLiteralChar =51 ,
4343 H_NEWLINE =52 ;
4444 public static final int
45- RULE_configFile = 0 , RULE_body = 1 , RULE_bodyContent = 2 , RULE_attribute = 3 ,
46- RULE_block = 4 , RULE_blockLabel = 5 , RULE_expression = 6 , RULE_exprTerm = 7 ,
47- RULE_blockExpr = 8 , RULE_literalValue = 9 , RULE_collectionValue = 10 ,
48- RULE_tuple = 11 , RULE_object = 12 , RULE_objectelem = 13 , RULE_qualifiedIdentifier = 14 ,
49- RULE_forExpr = 15 , RULE_forTupleExpr = 16 , RULE_forObjectExpr = 17 , RULE_forIntro = 18 ,
50- RULE_forCond = 19 , RULE_variableExpr = 20 , RULE_functionCall = 21 , RULE_functionName = 22 ,
51- RULE_arguments = 23 , RULE_index = 24 , RULE_getAttr = 25 , RULE_legacyIndexAttr = 26 ,
52- RULE_splat = 27 , RULE_attrSplat = 28 , RULE_fullSplat = 29 , RULE_operation = 30 ,
53- RULE_unaryOp = 31 , RULE_binaryOp = 32 , RULE_binaryOperator = 33 , RULE_compareOperator = 34 ,
54- RULE_arithmeticOperator = 35 , RULE_logicOperator = 36 , RULE_templateExpr = 37 ,
55- RULE_heredocTemplatePart = 38 , RULE_heredocLiteral = 39 , RULE_quotedTemplatePart = 40 ,
45+ RULE_configFile = 0 , RULE_body = 1 , RULE_bodyContent = 2 , RULE_attribute = 3 ,
46+ RULE_block = 4 , RULE_blockLabel = 5 , RULE_expression = 6 , RULE_exprTerm = 7 ,
47+ RULE_blockExpr = 8 , RULE_literalValue = 9 , RULE_collectionValue = 10 ,
48+ RULE_tuple = 11 , RULE_object = 12 , RULE_objectelem = 13 , RULE_qualifiedIdentifier = 14 ,
49+ RULE_forExpr = 15 , RULE_forTupleExpr = 16 , RULE_forObjectExpr = 17 , RULE_forIntro = 18 ,
50+ RULE_forCond = 19 , RULE_variableExpr = 20 , RULE_functionCall = 21 , RULE_functionName = 22 ,
51+ RULE_arguments = 23 , RULE_index = 24 , RULE_getAttr = 25 , RULE_legacyIndexAttr = 26 ,
52+ RULE_splat = 27 , RULE_attrSplat = 28 , RULE_fullSplat = 29 , RULE_operation = 30 ,
53+ RULE_unaryOp = 31 , RULE_binaryOp = 32 , RULE_binaryOperator = 33 , RULE_compareOperator = 34 ,
54+ RULE_arithmeticOperator = 35 , RULE_logicOperator = 36 , RULE_templateExpr = 37 ,
55+ RULE_heredocTemplatePart = 38 , RULE_heredocLiteral = 39 , RULE_quotedTemplatePart = 40 ,
5656 RULE_stringLiteral = 41 , RULE_templateInterpolation = 42 ;
5757 private static String [] makeRuleNames () {
5858 return new String [] {
59- "configFile" , "body" , "bodyContent" , "attribute" , "block" , "blockLabel" ,
60- "expression" , "exprTerm" , "blockExpr" , "literalValue" , "collectionValue" ,
61- "tuple" , "object" , "objectelem" , "qualifiedIdentifier" , "forExpr" , "forTupleExpr" ,
62- "forObjectExpr" , "forIntro" , "forCond" , "variableExpr" , "functionCall" ,
63- "functionName" , "arguments" , "index" , "getAttr" , "legacyIndexAttr" , "splat" ,
64- "attrSplat" , "fullSplat" , "operation" , "unaryOp" , "binaryOp" , "binaryOperator" ,
65- "compareOperator" , "arithmeticOperator" , "logicOperator" , "templateExpr" ,
66- "heredocTemplatePart" , "heredocLiteral" , "quotedTemplatePart" , "stringLiteral" ,
59+ "configFile" , "body" , "bodyContent" , "attribute" , "block" , "blockLabel" ,
60+ "expression" , "exprTerm" , "blockExpr" , "literalValue" , "collectionValue" ,
61+ "tuple" , "object" , "objectelem" , "qualifiedIdentifier" , "forExpr" , "forTupleExpr" ,
62+ "forObjectExpr" , "forIntro" , "forCond" , "variableExpr" , "functionCall" ,
63+ "functionName" , "arguments" , "index" , "getAttr" , "legacyIndexAttr" , "splat" ,
64+ "attrSplat" , "fullSplat" , "operation" , "unaryOp" , "binaryOp" , "binaryOperator" ,
65+ "compareOperator" , "arithmeticOperator" , "logicOperator" , "templateExpr" ,
66+ "heredocTemplatePart" , "heredocLiteral" , "quotedTemplatePart" , "stringLiteral" ,
6767 "templateInterpolation"
6868 };
6969 }
7070 public static final String [] ruleNames = makeRuleNames ();
7171
7272 private static String [] makeLiteralNames () {
7373 return new String [] {
74- null , null , null , "'if'" , "'in'" , null , "'null'" , "'{'" , "'}'" , "'='" ,
75- null , null , null , null , null , null , null , null , "'+'" , "'&&'" , "'=='" ,
76- "'<'" , "'::'" , "':'" , "'['" , "'('" , "'-'" , "'||'" , "'!='" , "'>'" , "'?'" ,
77- "']'" , "')'" , "'*'" , "'!'" , "'<='" , "'.'" , "'/'" , "'>='" , "'=>'" , "','" ,
78- "'%'" , "'...'" , "'~'" , null , null , null , null , null , null , null , null ,
74+ null , null , null , "'if'" , "'in'" , null , "'null'" , "'{'" , "'}'" , "'='" ,
75+ null , null , null , null , null , null , null , null , "'+'" , "'&&'" , "'=='" ,
76+ "'<'" , "'::'" , "':'" , "'['" , "'('" , "'-'" , "'||'" , "'!='" , "'>'" , "'?'" ,
77+ "']'" , "')'" , "'*'" , "'!'" , "'<='" , "'.'" , "'/'" , "'>='" , "'=>'" , "','" ,
78+ "'%'" , "'...'" , "'~'" , null , null , null , null , null , null , null , null ,
7979 "'\\ n'"
8080 };
8181 }
8282 private static final String [] _LITERAL_NAMES = makeLiteralNames ();
8383 private static String [] makeSymbolicNames () {
8484 return new String [] {
85- null , "FOR_BRACE" , "FOR_BRACK" , "IF" , "IN" , "BooleanLiteral" , "NULL" ,
86- "LBRACE" , "RBRACE" , "ASSIGN" , "Identifier" , "WS" , "COMMENT" , "LINE_COMMENT" ,
87- "NEWLINE" , "NumericLiteral" , "QUOTE" , "HEREDOC_START" , "PLUS" , "AND" ,
88- "EQ" , "LT" , "DOUBLE_COLON" , "COLON" , "LBRACK" , "LPAREN" , "MINUS" , "OR" ,
89- "NEQ" , "GT" , "QUESTION" , "RBRACK" , "RPAREN" , "MUL" , "NOT" , "LEQ" , "DOT" ,
90- "DIV" , "GEQ" , "ARROW" , "COMMA" , "MOD" , "ELLIPSIS" , "TILDE" , "TEMPLATE_INTERPOLATION_START" ,
91- "TemplateStringLiteral" , "TemplateStringLiteralChar" , "HP_WS" , "HP_COMMENT" ,
85+ null , "FOR_BRACE" , "FOR_BRACK" , "IF" , "IN" , "BooleanLiteral" , "NULL" ,
86+ "LBRACE" , "RBRACE" , "ASSIGN" , "Identifier" , "WS" , "COMMENT" , "LINE_COMMENT" ,
87+ "NEWLINE" , "NumericLiteral" , "QUOTE" , "HEREDOC_START" , "PLUS" , "AND" ,
88+ "EQ" , "LT" , "DOUBLE_COLON" , "COLON" , "LBRACK" , "LPAREN" , "MINUS" , "OR" ,
89+ "NEQ" , "GT" , "QUESTION" , "RBRACK" , "RPAREN" , "MUL" , "NOT" , "LEQ" , "DOT" ,
90+ "DIV" , "GEQ" , "ARROW" , "COMMA" , "MOD" , "ELLIPSIS" , "TILDE" , "TEMPLATE_INTERPOLATION_START" ,
91+ "TemplateStringLiteral" , "TemplateStringLiteralChar" , "HP_WS" , "HP_COMMENT" ,
9292 "HP_LINE_COMMENT" , "HTemplateLiteral" , "HTemplateLiteralChar" , "H_NEWLINE"
9393 };
9494 }
@@ -515,7 +515,7 @@ public ExpressionContext(ParserRuleContext parent, int invokingState) {
515515 super (parent , invokingState );
516516 }
517517 @ Override public int getRuleIndex () { return RULE_expression ; }
518-
518+
519519 public ExpressionContext () { }
520520 public void copyFrom (ExpressionContext ctx ) {
521521 super .copyFrom (ctx );
@@ -648,7 +648,7 @@ private ExpressionContext expression(int _p) throws RecognitionException {
648648 setState (127 );
649649 expression (2 );
650650 }
651- }
651+ }
652652 }
653653 setState (133 );
654654 _errHandler .sync (this );
@@ -673,7 +673,7 @@ public ExprTermContext(ParserRuleContext parent, int invokingState) {
673673 super (parent , invokingState );
674674 }
675675 @ Override public int getRuleIndex () { return RULE_exprTerm ; }
676-
676+
677677 public ExprTermContext () { }
678678 public void copyFrom (ExprTermContext ctx ) {
679679 super .copyFrom (ctx );
@@ -1054,7 +1054,7 @@ private ExprTermContext exprTerm(int _p) throws RecognitionException {
10541054 }
10551055 break ;
10561056 }
1057- }
1057+ }
10581058 }
10591059 setState (159 );
10601060 _errHandler .sync (this );
@@ -1303,7 +1303,7 @@ public final TupleContext tuple() throws RecognitionException {
13031303 setState (173 );
13041304 expression (0 );
13051305 }
1306- }
1306+ }
13071307 }
13081308 setState (178 );
13091309 _errHandler .sync (this );
@@ -2186,7 +2186,7 @@ public final ArgumentsContext arguments() throws RecognitionException {
21862186 setState (282 );
21872187 expression (0 );
21882188 }
2189- }
2189+ }
21902190 }
21912191 setState (287 );
21922192 _errHandler .sync (this );
@@ -2479,7 +2479,7 @@ public final AttrSplatContext attrSplat() throws RecognitionException {
24792479 setState (307 );
24802480 getAttr ();
24812481 }
2482- }
2482+ }
24832483 }
24842484 setState (312 );
24852485 _errHandler .sync (this );
@@ -2571,7 +2571,7 @@ public final FullSplatContext fullSplat() throws RecognitionException {
25712571 default :
25722572 throw new NoViableAltException (this );
25732573 }
2574- }
2574+ }
25752575 }
25762576 setState (322 );
25772577 _errHandler .sync (this );
@@ -3066,7 +3066,7 @@ public TemplateExprContext(ParserRuleContext parent, int invokingState) {
30663066 super (parent , invokingState );
30673067 }
30683068 @ Override public int getRuleIndex () { return RULE_templateExpr ; }
3069-
3069+
30703070 public TemplateExprContext () { }
30713071 public void copyFrom (TemplateExprContext ctx ) {
30723072 super .copyFrom (ctx );
@@ -3148,7 +3148,7 @@ public final TemplateExprContext templateExpr() throws RecognitionException {
31483148 match (HEREDOC_START );
31493149 setState (351 );
31503150 match (Identifier );
3151- setState (359 );
3151+ setState (359 );
31523152 _errHandler .sync (this );
31533153 _la = _input .LA (1 );
31543154 do {
@@ -3172,7 +3172,7 @@ public final TemplateExprContext templateExpr() throws RecognitionException {
31723172 }
31733173 }
31743174 }
3175- setState (361 );
3175+ setState (361 );
31763176 _errHandler .sync (this );
31773177 _la = _input .LA (1 );
31783178 } while ( _la ==NEWLINE );
@@ -3768,4 +3768,4 @@ private boolean exprTerm_sempred(ExprTermContext _localctx, int predIndex) {
37683768 _decisionToDFA [i ] = new DFA (_ATN .getDecisionState (i ), i );
37693769 }
37703770 }
3771- }
3771+ }
0 commit comments