Class DockerLexicalConstant
- java.lang.Object
-
- org.sonar.iac.docker.parser.grammar.DockerLexicalConstant
-
public class DockerLexicalConstant extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMMENTstatic StringENCAPS_VAR_MODIFIER_GENERICstatic StringENCAPS_VAR_MODIFIER_SEPARATORstatic StringEOLstatic StringEQUALS_OPERATORstatic StringESCAPED_UNQUOTED_STRING_CHARACTERSstatic StringFLAG_NAMEstatic StringHEREDOC_EXPRESSIONstatic StringHEREDOC_NAMERegexes to match Docker heredoc expression as described in the Docker reference.static StringIMAGE_ALIASstatic StringLINE_BREAKstatic StringQUOTED_STRING_LITERALstatic StringSTRING_LITERAL_OLDstatic StringSTRING_LITERAL_WITH_QUOTESstatic StringSTRING_LITERAL_WITHOUT_QUOTESstatic StringSTRING_WITH_ENCAPS_VAR_CHARACTERSstatic StringUNQUOTED_KEY_LITERALstatic StringUNQUOTED_STRING_LITERALstatic StringUNQUOTED_VARIABLE_MODIFIERAllow to match the modifier of a variable in a dockerfile.static StringVAR_IDENTIFIER
-
-
-
Field Detail
-
COMMENT
public static final String COMMENT
- See Also:
- Constant Field Values
-
EOL
public static final String EOL
- See Also:
- Constant Field Values
-
LINE_BREAK
public static final String LINE_BREAK
- See Also:
- Constant Field Values
-
STRING_LITERAL_WITH_QUOTES
public static final String STRING_LITERAL_WITH_QUOTES
- See Also:
- Constant Field Values
-
STRING_LITERAL_WITHOUT_QUOTES
public static final String STRING_LITERAL_WITHOUT_QUOTES
- See Also:
- Constant Field Values
-
STRING_LITERAL_OLD
public static final String STRING_LITERAL_OLD
- See Also:
- Constant Field Values
-
EQUALS_OPERATOR
public static final String EQUALS_OPERATOR
- See Also:
- Constant Field Values
-
VAR_IDENTIFIER
public static final String VAR_IDENTIFIER
- See Also:
- Constant Field Values
-
ENCAPS_VAR_MODIFIER_SEPARATOR
public static final String ENCAPS_VAR_MODIFIER_SEPARATOR
- See Also:
- Constant Field Values
-
ENCAPS_VAR_MODIFIER_GENERIC
public static final String ENCAPS_VAR_MODIFIER_GENERIC
- See Also:
- Constant Field Values
-
FLAG_NAME
public static final String FLAG_NAME
- See Also:
- Constant Field Values
-
STRING_WITH_ENCAPS_VAR_CHARACTERS
public static final String STRING_WITH_ENCAPS_VAR_CHARACTERS
- See Also:
- Constant Field Values
-
QUOTED_STRING_LITERAL
public static final String QUOTED_STRING_LITERAL
- See Also:
- Constant Field Values
-
ESCAPED_UNQUOTED_STRING_CHARACTERS
public static final String ESCAPED_UNQUOTED_STRING_CHARACTERS
- See Also:
- Constant Field Values
-
UNQUOTED_STRING_LITERAL
public static final String UNQUOTED_STRING_LITERAL
- See Also:
- Constant Field Values
-
UNQUOTED_VARIABLE_MODIFIER
public static final String UNQUOTED_VARIABLE_MODIFIER
Allow to match the modifier of a variable in a dockerfile. Currently more permissive as it allow to match any characters except unescaped $, ' and " until it find a }. There is also a lookahead in the end to ensure the match is followed by a closing } without matching it.- See Also:
- Constant Field Values
-
UNQUOTED_KEY_LITERAL
public static final String UNQUOTED_KEY_LITERAL
- See Also:
- Constant Field Values
-
HEREDOC_NAME
public static final String HEREDOC_NAME
Regexes to match Docker heredoc expression as described in the Docker reference. It starts with the heredoc indicator (2 Less-than signs), followed by an optional minus, followed by an optional double quote then the 1st capturing group (the heredoc block name), followed again by an optional double quote. In 1st capturing group: one or more (possessive) uppercase/lowercase letters, numbers, or underscore. The key part is the reference to the heredoc block name which end the heredoc block by having this element alone in a line. This regex also allow having multiple heredoc block name, it will then end until the last matched block.- See Also:
- Constant Field Values
-
HEREDOC_EXPRESSION
public static final String HEREDOC_EXPRESSION
- See Also:
- Constant Field Values
-
IMAGE_ALIAS
public static final String IMAGE_ALIAS
- See Also:
- Constant Field Values
-
-