org.antlr.runtime
Class ParserRuleReturnScope

java.lang.Object
  extended by org.antlr.runtime.RuleReturnScope
      extended by org.antlr.runtime.ParserRuleReturnScope
Direct Known Subclasses:
ANTLRv3Parser.action_return, ANTLRv3Parser.actionScopeName_return, ANTLRv3Parser.alternative_return, ANTLRv3Parser.altList_return, ANTLRv3Parser.altpair_return, ANTLRv3Parser.atom_return, ANTLRv3Parser.attrScope_return, ANTLRv3Parser.block_return, ANTLRv3Parser.ebnf_return, ANTLRv3Parser.ebnfSuffix_return, ANTLRv3Parser.element_return, ANTLRv3Parser.elementOption_return, ANTLRv3Parser.elementOptions_return, ANTLRv3Parser.exceptionGroup_return, ANTLRv3Parser.exceptionHandler_return, ANTLRv3Parser.finallyClause_return, ANTLRv3Parser.grammarDef_return, ANTLRv3Parser.id_return, ANTLRv3Parser.notSet_return, ANTLRv3Parser.notTerminal_return, ANTLRv3Parser.option_return, ANTLRv3Parser.optionsSpec_return, ANTLRv3Parser.optionValue_return, ANTLRv3Parser.qid_return, ANTLRv3Parser.range_return, ANTLRv3Parser.rewrite_alternative_return, ANTLRv3Parser.rewrite_indirect_template_head_return, ANTLRv3Parser.rewrite_return, ANTLRv3Parser.rewrite_template_arg_return, ANTLRv3Parser.rewrite_template_args_return, ANTLRv3Parser.rewrite_template_ref_return, ANTLRv3Parser.rewrite_template_return, ANTLRv3Parser.rewrite_tree_alternative_return, ANTLRv3Parser.rewrite_tree_atom_return, ANTLRv3Parser.rewrite_tree_block_return, ANTLRv3Parser.rewrite_tree_ebnf_return, ANTLRv3Parser.rewrite_tree_element_return, ANTLRv3Parser.rewrite_tree_return, ANTLRv3Parser.rule_return, ANTLRv3Parser.ruleAction_return, ANTLRv3Parser.ruleScopeSpec_return, ANTLRv3Parser.terminal_return, ANTLRv3Parser.throwsSpec_return, ANTLRv3Parser.tokenSpec_return, ANTLRv3Parser.tokensSpec_return, ANTLRv3Parser.treeSpec_return

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.


Field Summary
 Token start
           
 Token stop
           
 
Constructor Summary
ParserRuleReturnScope()
           
 
Method Summary
 java.lang.Object getStart()
          Return the start token or tree
 java.lang.Object getStop()
          Return the stop token or tree
 
Methods inherited from class org.antlr.runtime.RuleReturnScope
getTemplate, getTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

start

public Token start

stop

public Token stop
Constructor Detail

ParserRuleReturnScope

public ParserRuleReturnScope()
Method Detail

getStart

public java.lang.Object getStart()
Description copied from class: RuleReturnScope
Return the start token or tree

Overrides:
getStart in class RuleReturnScope

getStop

public java.lang.Object getStop()
Description copied from class: RuleReturnScope
Return the stop token or tree

Overrides:
getStop in class RuleReturnScope


Copyright © 2013. All Rights Reserved.