From 1d3910a78b25a16df6774bc33e64305d43c46db6 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Tue, 26 Mar 2013 17:02:14 -0500 Subject: [PATCH] Updated documentation of Parser fields --- .../Java/src/org/antlr/v4/runtime/Parser.java | 44 +++++++++++++------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/Parser.java b/runtime/Java/src/org/antlr/v4/runtime/Parser.java index 828d04ddf..db8cfada9 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/Parser.java +++ b/runtime/Java/src/org/antlr/v4/runtime/Parser.java @@ -93,31 +93,49 @@ public abstract class Parser extends Recognizer { } } + /** + * The error handling strategy for the parser. The default value is a new + * instance of {@link DefaultErrorStrategy}. + * + * @see #getErrorHandler + * @see #setErrorHandler + */ @NotNull protected ANTLRErrorStrategy _errHandler = new DefaultErrorStrategy(); + /** + * The input stream. + * + * @see #getInputStream + * @see #setInputStream + */ protected TokenStream _input; - /** The RuleContext object for the currently executing rule. This - * must be non-null during parsing, but is initially null. - * When somebody calls the start rule, this gets set to the - * root context. + /** + * The {@link ParserRuleContext} object for the currently executing rule. + * This is always non-null during the parsing process. */ protected ParserRuleContext _ctx; + /** + * Specifies whether or not the parser should construct a parse tree during + * the parsing process. The default value is {@code true}. + * + * @see #getBuildParseTree + * @see #setBuildParseTree + */ protected boolean _buildParseTrees = true; protected TraceListener _tracer; - /** If the listener is non-null, trigger enter and exit rule events - * *during* the parse. This is typically done only when not building - * parse trees for later visiting. We either trigger events during - * the parse or during tree walks later. Both could be done. - * Not intended for average user!!! Most people should use - * ParseTreeListener with ParseTreeWalker. - * @see ParseTreeWalker - */ - protected List _parseListeners; + /** + * The list of {@link ParseTreeListener} listeners registered to receive + * events during the parse. + * + * @see #addParseListener + */ + @Nullable + protected List _parseListeners; /** * The number of syntax errors reported during parsing. This value is