Package dap4.core.ce.parser
Class CEParserImpl
- java.lang.Object
-
- dap4.core.ce.parser.CEParserImpl
-
public class CEParserImpl extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
bisonSkeleton
Name of the skeleton that generated this parser.static String
bisonVersion
Version number for the Bison executable that generated this parser.protected CEAST
constraint
protected Map<String,Slice>
dimdefs
protected static int
globaldebuglevel
protected DapDataset
template
static int
YYABORT
Returned by a Bison action in order to stop the parsing process and return failure (false).static int
YYACCEPT
Returned by a Bison action in order to stop the parsing process and return success (true).static int
YYERROR
Returned by a Bison action in order to start error recovery without printing an error message.
-
Constructor Summary
Constructors Constructor Description CEParserImpl(DapDataset template)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CEAST
getCEAST()
int
getDebugLevel()
Answer the verbosity of the debugging output; 0 means that all kinds of output from the parser are suppressed.PrintStream
getDebugStream()
The PrintStream on which the debugging output is printed.boolean
getErrorVerbose()
Whether verbose error messages are enabled.int
getNumberOfErrors()
The number of syntax errors so far.boolean
parse()
Parse input from the scanner that was specified at object construction time.boolean
parse(String document)
boolean
recovering()
Whether error recovery is being done.void
setDebugLevel(int level)
Set the verbosity of the debugging output; 0 means that all kinds of output from the parser are suppressed.void
setDebugStream(PrintStream s)
Set the PrintStream on which the debug output is printed.void
setErrorVerbose(boolean verbose)
Set the verbosity of error messages.static void
setGlobalDebugLevel(int level)
protected void
yycdebug(String s)
protected void
yycdebugNnl(String s)
void
yyerror(String msg)
Print an error message via the lexer.
-
-
-
Field Detail
-
globaldebuglevel
protected static int globaldebuglevel
-
template
protected DapDataset template
-
constraint
protected CEAST constraint
-
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
-
CEParserImpl
public CEParserImpl(DapDataset template) throws ParseException
- Throws:
ParseException
-
-
Method Detail
-
setGlobalDebugLevel
public static void setGlobalDebugLevel(int level)
-
getCEAST
public CEAST getCEAST()
-
parse
public boolean parse(String document) throws ParseException
- Throws:
ParseException
-
getErrorVerbose
public final boolean getErrorVerbose()
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()
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.
-
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.- Parameters:
level
- The verbosity level for debugging output.
-
getNumberOfErrors
public final int getNumberOfErrors()
The number of syntax errors so far.
-
yyerror
public final void yyerror(String msg)
Print an error message via the lexer.- Parameters:
msg
- The error message.
-
yycdebugNnl
protected final void yycdebugNnl(String s)
-
yycdebug
protected final void yycdebug(String s)
-
recovering
public final boolean recovering()
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, ParseException
Parse 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
-
-