Class AntlrElement
java.lang.Object
cool.klass.model.converter.compiler.state.AntlrElement
- All Implemented Interfaces:
IAntlrElement
- Direct Known Subclasses:
AbstractAntlrPropertyValidation,AntlrClassifierReference,AntlrClassReference,AntlrCompilationUnit,AntlrCriteria,AntlrExpressionValue,AntlrMultiplicity,AntlrOperator,AntlrOrderBy,AntlrOrderByDirection,AntlrOrderByMemberReferencePath,AntlrOrdinalElement,AntlrPrimitiveType,AntlrRelationship,AntlrService,AntlrServiceCriteria,AntlrServiceMultiplicity,AntlrServiceProjectionDispatch,AntlrUrl,AntlrVerb
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.antlr.v4.runtime.ParserRuleContextprotected final Optional<CompilationUnit>The type of compilationUnit is Optional because some Elements, specifically PrimitiveTypes are not declared in SourceCodeprotected final org.antlr.v4.runtime.ParserRuleContextstatic final org.antlr.v4.runtime.ParserRuleContext -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAntlrElement(org.antlr.v4.runtime.ParserRuleContext elementContext, Optional<CompilationUnit> compilationUnit) -
Method Summary
Modifier and TypeMethodDescriptionorg.antlr.v4.runtime.ParserRuleContextprotected Optional<AbstractElement.ElementBuilder<?>>protected SourceCode.SourceCodeBuilderprotected static StringgetSourceText(org.antlr.v4.runtime.ParserRuleContext parserRuleContext) static StringgetSourceTextLenient(org.antlr.v4.runtime.ParserRuleContext parserRuleContext) This method is meant to be used by data renderers in the IntelliJ debugger.booleanhasMacro()booleanisForwardReference(AntlrElement other) booleantoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface cool.klass.model.converter.compiler.state.IAntlrElement
gatherSurroundingElements, getContextAfter, getContextBefore, getEntireContext, getSurroundingElement, getSurroundingElement, getSurroundingElements, isContext, reportAuditErrors
-
Field Details
-
AMBIGUOUS_PARENT
public static final org.antlr.v4.runtime.ParserRuleContext AMBIGUOUS_PARENT -
NOT_FOUND_PARENT
public static final org.antlr.v4.runtime.ParserRuleContext NOT_FOUND_PARENT -
elementContext
@Nonnull protected final org.antlr.v4.runtime.ParserRuleContext elementContext -
compilationUnit
The type of compilationUnit is Optional because some Elements, specifically PrimitiveTypes are not declared in SourceCode
-
-
Constructor Details
-
AntlrElement
protected AntlrElement(@Nonnull org.antlr.v4.runtime.ParserRuleContext elementContext, @Nonnull Optional<CompilationUnit> compilationUnit)
-
-
Method Details
-
getSourceTextLenient
This method is meant to be used by data renderers in the IntelliJ debugger. It is lenient to accept sentinels like AMBIGUOUS and NOT_FOUND.- Parameters:
parserRuleContext- the parserRuleContext to get the source text of- Returns:
- the source text of the given parserRuleContext, or "AMBIGUOUS" or "NOT_FOUND" if the parserRuleContext is a sentinel
- Throws:
AssertionError- if the parserRuleContext is not a sentinel but looks too much like a sentinel
-
getSourceText
-
getElementContext
@Nonnull public org.antlr.v4.runtime.ParserRuleContext getElementContext()- Specified by:
getElementContextin interfaceIAntlrElement
-
getElementBuilder
-
getMacroElement
- Specified by:
getMacroElementin interfaceIAntlrElement
-
hasMacro
public boolean hasMacro() -
getMacroElementBuilder
-
getSourceCodeBuilder
-
getCompilationUnit
- Specified by:
getCompilationUnitin interfaceIAntlrElement
-
isInSameCompilationUnit
-
isForwardReference
-
toString
-