Package org.antlr.v4.codegen.model
Class SrcOp
- java.lang.Object
-
- org.antlr.v4.codegen.model.OutputModelObject
-
- org.antlr.v4.codegen.model.SrcOp
-
- Direct Known Subclasses:
AddToLabelList,CaptureNextToken,CaptureNextTokenType,CodeBlock,Decl,ExceptionClause,RuleElement,Sync,TestSetInline,ThrowRecognitionException
public abstract class SrcOp extends OutputModelObject
-
-
Field Summary
Fields Modifier and Type Field Description CodeBlockenclosingBlockAll operations know in which block they live: CodeBlock, CodeBlockForAlt Templates might need to know block nesting level or find a specific declaration, etc...RuleFunctionenclosingRuleRunctionintuniqueIDUsed to create unique var names etc...-
Fields inherited from class org.antlr.v4.codegen.model.OutputModelObject
ast, factory
-
-
Constructor Summary
Constructors Constructor Description SrcOp(OutputModelFactory factory)SrcOp(OutputModelFactory factory, GrammarAST ast)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContextName()Return label alt or return name of ruleCodeBlockForOuterMostAltgetOuterMostAltCodeBlock()Walk upwards in model tree, looking for outer alt's code block
-
-
-
Field Detail
-
uniqueID
public int uniqueID
Used to create unique var names etc...
-
enclosingBlock
public CodeBlock enclosingBlock
All operations know in which block they live: CodeBlock, CodeBlockForAlt Templates might need to know block nesting level or find a specific declaration, etc...
-
enclosingRuleRunction
public RuleFunction enclosingRuleRunction
-
-
Constructor Detail
-
SrcOp
public SrcOp(OutputModelFactory factory)
-
SrcOp
public SrcOp(OutputModelFactory factory, GrammarAST ast)
-
-
Method Detail
-
getOuterMostAltCodeBlock
public CodeBlockForOuterMostAlt getOuterMostAltCodeBlock()
Walk upwards in model tree, looking for outer alt's code block
-
getContextName
public String getContextName()
Return label alt or return name of rule
-
-