Class ParseShape<C extends ParserRuleContext,N extends ASTNode>
java.lang.Object
io.github.douira.glsl_transformer.parser.ParseShape<C,N>
A static data class that contains the information needed to parse and build a
specific type of node. Contains the class of the rule context, a method of
GLSLParser to parse this kind of rule context from a string, and a
method of ASTBuilder to build an AST node from a rule context.
Usually the static pre-made instances of this class are sufficient but
additional specific instances can be created and should then be stored as a
static final field for reuse.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParseShape<io.github.douira.glsl_transformer.GLSLParser.ExpressionContext,Expression> static final ParseShape<io.github.douira.glsl_transformer.GLSLParser.ExternalDeclarationContext,ExternalDeclaration> static final ParseShape<io.github.douira.glsl_transformer.GLSLParser.FullySpecifiedTypeContext,FullySpecifiedType> static final ParseShape<io.github.douira.glsl_transformer.GLSLParser.StatementContext,Statement> static final ParseShape<io.github.douira.glsl_transformer.GLSLParser.TranslationUnitContext,TranslationUnit> final BiFunction<ASTBuilder,C, N> -
Constructor Summary
ConstructorsConstructorDescriptionParseShape(Class<C> ruleType, Function<io.github.douira.glsl_transformer.GLSLParser, C> parseMethod, BiFunction<ASTBuilder, C, N> visitMethod) -
Method Summary
-
Field Details
-
TRANSLATION_UNIT
public static final ParseShape<io.github.douira.glsl_transformer.GLSLParser.TranslationUnitContext,TranslationUnit> TRANSLATION_UNIT -
EXTERNAL_DECLARATION
public static final ParseShape<io.github.douira.glsl_transformer.GLSLParser.ExternalDeclarationContext,ExternalDeclaration> EXTERNAL_DECLARATION -
STATEMENT
public static final ParseShape<io.github.douira.glsl_transformer.GLSLParser.StatementContext,Statement> STATEMENT -
EXPRESSION
public static final ParseShape<io.github.douira.glsl_transformer.GLSLParser.ExpressionContext,Expression> EXPRESSION -
FULLY_SPECIFIED_TYPE
public static final ParseShape<io.github.douira.glsl_transformer.GLSLParser.FullySpecifiedTypeContext,FullySpecifiedType> FULLY_SPECIFIED_TYPE -
ruleType
-
parseMethod
public final Function<io.github.douira.glsl_transformer.GLSLParser,C extends ParserRuleContext> parseMethod -
visitMethod
-
-
Constructor Details
-
ParseShape
public ParseShape(Class<C> ruleType, Function<io.github.douira.glsl_transformer.GLSLParser, C> parseMethod, BiFunction<ASTBuilder, C, N> visitMethod)
-
-
Method Details
-
_parseNodeSeparateInternal
-