Add a little bit of documentation to ParserRuleContext

This commit is contained in:
Michael Peyton Jones 2014-10-16 16:12:33 +01:00
parent 6aa36090dc
commit 6acb8e7e46
1 changed files with 10 additions and 0 deletions

View File

@ -278,7 +278,17 @@ public class ParserRuleContext extends RuleContext {
return Interval.of(start.getTokenIndex(), stop.getTokenIndex());
}
/**
* Get the initial token in this context.
* Note that the range from start to stop is inclusive, so for rules that do not consume anything
* (for example, zero length or error productions) this token may succeed stop.
*/
public Token getStart() { return start; }
/**
* Get the final token in this context.
* Note that the range from start to stop is inclusive, so for rules that do not consume anything
* (for example, zero length or error productions) this token may precede start.
*/
public Token getStop() { return stop; }
/** Used for rule context info debugging during parse-time, not so much for ATN debugging */