Package opendap.dap.parsers
Class Dap2Parser
- java.lang.Object
-
- opendap.dap.parsers.Dap2Parse
-
- opendap.dap.parsers.Dap2Parser
-
public class Dap2Parser extends Dap2Parse
A Bison parser, automatically generated from dap2.y.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDap2Parser.LexerCommunication interface between the scanner and the Bison-generated parser Dap2Parser.
-
Field Summary
Fields Modifier and Type Field Description static StringbisonSkeletonName of the skeleton that generated this parser.static StringbisonVersionVersion number for the Bison executable that generated this parser.static intYYABORTReturned by a Bison action in order to stop the parsing process and return failure (false).static intYYACCEPTReturned by a Bison action in order to stop the parsing process and return success (true).static intYYERRORReturned by a Bison action in order to start error recovery without printing an error message.
-
Constructor Summary
Constructors Constructor Description Dap2Parser(BaseTypeFactory factory)Instantiates the Bison-generated parser.Dap2Parser(Dap2Parser.Lexer yylexer)Instantiates the Bison-generated parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDebugLevel()Answer the verbosity of the debugging output; 0 means that all kinds of output from the parser are suppressed.PrintStreamgetDebugStream()Return the PrintStream on which the debugging output is printed.booleangetErrorVerbose()Return whether verbose error messages are enabled.StringgetURL()booleanparse()Parse input from the scanner that was specified at object construction time.booleanparse(String input)**********************************************booleanrecovering()Return whether error recovery is being done.voidsetDebugLevel(int level)Set the verbosity of the debugging output; 0 means that all kinds of output from the parser are suppressed.voidsetDebugStream(PrintStream s)Set the PrintStream on which the debug output is printed.voidsetErrorVerbose(boolean verbose)Set the verbosity of error messages.voidsetURL(String url)protected voidyycdebug(String s)voidyyerror(String msg)Print an error message via the lexer.
-
-
-
Field Detail
-
bisonVersion
public static final String bisonVersion
Version number for the Bison executable that generated this parser.- See Also:
- Constant Field Values
-
bisonSkeleton
public static final String bisonSkeleton
Name of the skeleton that generated this parser.- See Also:
- Constant Field Values
-
YYACCEPT
public static final int YYACCEPT
Returned by a Bison action in order to stop the parsing process and return success (true).- See Also:
- Constant Field Values
-
YYABORT
public static final int YYABORT
Returned by a Bison action in order to stop the parsing process and return failure (false).- See Also:
- Constant Field Values
-
YYERROR
public static final int YYERROR
Returned by a Bison action in order to start error recovery without printing an error message.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Dap2Parser
public Dap2Parser(Dap2Parser.Lexer yylexer)
Instantiates the Bison-generated parser.- Parameters:
yylexer- The scanner that will supply tokens to the parser.
-
Dap2Parser
public Dap2Parser(BaseTypeFactory factory)
Instantiates the Bison-generated parser.- Parameters:
factory- the factory for generating tree nodes
-
-
Method Detail
-
getErrorVerbose
public final boolean getErrorVerbose()
Return whether verbose error messages are enabled.
-
setErrorVerbose
public final void setErrorVerbose(boolean verbose)
Set the verbosity of error messages.- Parameters:
verbose- True to request verbose error messages.
-
getDebugStream
public final PrintStream getDebugStream()
Return the PrintStream on which the debugging output is printed.
-
setDebugStream
public final void setDebugStream(PrintStream s)
Set the PrintStream on which the debug output is printed.- Parameters:
s- The stream that is used for debugging output.
-
getDebugLevel
public final int getDebugLevel()
Answer the verbosity of the debugging output; 0 means that all kinds of output from the parser are suppressed.- Specified by:
getDebugLevelin classDap2Parse
-
setDebugLevel
public final void setDebugLevel(int level)
Set the verbosity of the debugging output; 0 means that all kinds of output from the parser are suppressed.- Specified by:
setDebugLevelin classDap2Parse- Parameters:
level- The verbosity level for debugging output.
-
yyerror
public final void yyerror(String msg)
Print an error message via the lexer.- Parameters:
msg- The error message.
-
yycdebug
protected final void yycdebug(String s)
-
recovering
public final boolean recovering()
Return whether error recovery is being done. In this state, the parser reads token until it reaches a known state, and then restarts normal operation.
-
parse
public boolean parse() throws ParseException, ParseExceptionParse input from the scanner that was specified at object construction time. Return whether the end of the input was reached successfully.- Returns:
- true if the parsing succeeds. Note that this does not imply that there were no syntax errors.
- Throws:
ParseException
-
parse
public boolean parse(String input) throws ParseException
Description copied from class:Dap2Parse**********************************************- Specified by:
parsein classDap2Parse- Throws:
ParseException
-
-