Package org.antlr.runtime
Class ParserRuleReturnScope
- java.lang.Object
-
- org.antlr.runtime.RuleReturnScope
-
- org.antlr.runtime.ParserRuleReturnScope
-
public class ParserRuleReturnScope extends RuleReturnScope
Rules that return more than a single value must return an object containing all the values. Besides the properties defined in RuleLabelScope.predefinedRulePropertiesScope there may be user-defined return values. This class simply defines the minimum properties that are always defined and methods to access the others that might be available depending on output option such as template and tree. Note text is not an actual property of the return value, it is computed from start and stop using the input stream's toString() method. I could add a ctor to this so that we can pass in and store the input stream, but I'm not sure we want to do that. It would seem to be undefined to get the .text property anyway if the rule matches tokens from multiple input streams. I do not use getters for fields of objects that are used simply to group values such as this aggregate. The getters/setters are there to satisfy the superclass interface.
-
-
Constructor Summary
Constructors Constructor Description ParserRuleReturnScope()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getStart()
Return the start token or treeObject
getStop()
Return the stop token or treeObject
getTree()
Has a value potentially if output=AST;-
Methods inherited from class org.antlr.runtime.RuleReturnScope
getTemplate
-
-
-
-
Method Detail
-
getStart
public Object getStart()
Description copied from class:RuleReturnScope
Return the start token or tree- Overrides:
getStart
in classRuleReturnScope
-
getStop
public Object getStop()
Description copied from class:RuleReturnScope
Return the stop token or tree- Overrides:
getStop
in classRuleReturnScope
-
getTree
public Object getTree()
Description copied from class:RuleReturnScope
Has a value potentially if output=AST;- Overrides:
getTree
in classRuleReturnScope
-
-