opendap.dap.parser
Class DapParser

java.lang.Object
  extended by opendap.dap.parser.DapParser
Direct Known Subclasses:
DASParser, DDSParser, ErrorParser

public class DapParser
extends java.lang.Object

A Bison parser, automatically generated from dap.y.

Author:
LALR (1) parser skeleton written by Paolo Bonzini.

Nested Class Summary
static interface DapParser.Lexer
          Communication interface between the scanner and the Bison-generated parser DapParser.
 
Field Summary
static java.lang.String bisonSkeleton
          Name of the skeleton that generated this parser.
static java.lang.String bisonVersion
          Version number for the Bison executable that generated this parser.
protected  int dapdebug
           
static int EOF
          Token returned by the scanner to signal the end of its input.
 boolean errorVerbose
          True if verbose error messages are enabled.
static int SCAN_ALIAS
          Token number, to be returned by the scanner.
static int SCAN_ARRAY
          Token number, to be returned by the scanner.
static int SCAN_ATTR
          Token number, to be returned by the scanner.
static int SCAN_BYTE
          Token number, to be returned by the scanner.
static int SCAN_CODE
          Token number, to be returned by the scanner.
static int SCAN_DATA
          Token number, to be returned by the scanner.
static int SCAN_DATASET
          Token number, to be returned by the scanner.
static int SCAN_ERROR
          Token number, to be returned by the scanner.
static int SCAN_FLOAT32
          Token number, to be returned by the scanner.
static int SCAN_FLOAT64
          Token number, to be returned by the scanner.
static int SCAN_GRID
          Token number, to be returned by the scanner.
static int SCAN_INT16
          Token number, to be returned by the scanner.
static int SCAN_INT32
          Token number, to be returned by the scanner.
static int SCAN_MAPS
          Token number, to be returned by the scanner.
static int SCAN_MESSAGE
          Token number, to be returned by the scanner.
static int SCAN_PROG
          Token number, to be returned by the scanner.
static int SCAN_PTYPE
          Token number, to be returned by the scanner.
static int SCAN_SEQUENCE
          Token number, to be returned by the scanner.
static int SCAN_STRING
          Token number, to be returned by the scanner.
static int SCAN_STRUCTURE
          Token number, to be returned by the scanner.
static int SCAN_UINT16
          Token number, to be returned by the scanner.
static int SCAN_UINT32
          Token number, to be returned by the scanner.
static int SCAN_URL
          Token number, to be returned by the scanner.
static int SCAN_WORD
          Token number, to be returned by the scanner.
protected  java.io.InputStream stream
           
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.
static int YYFAIL
          Returned by a Bison action in order to print an error message and start error recovery.
 
Constructor Summary
DapParser(DapParser.Lexer yylexer, java.io.InputStream stream)
          Instantiates the Bison-generated parser.
DapParser(java.io.InputStream stream)
          Instantiates the Bison-generated parser.
DapParser(java.io.InputStream stream, BaseTypeFactory factory)
           
 
Method Summary
 void Attributes(DAS das)
           
 void Dataset(DDS dds, BaseTypeFactory factory)
           
 void Errorbody()
           
 DAS getDASroot()
           
 DDS getDDSroot()
           
 int getDebugLevel()
          Answer the verbosity of the debugging output; 0 means that all kinds of output from the parser are suppressed.
 java.io.PrintStream getDebugStream()
          Return the PrintStream on which the debugging output is printed.
 boolean parse()
          Parse input from the scanner that was specified at object construction time.
 boolean recovering()
          Return 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(java.io.PrintStream s)
          Set the PrintStream on which the debug output is printed.
protected  void yycdebug(java.lang.String s)
           
protected  void yyerror(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bisonVersion

public static final java.lang.String bisonVersion
Version number for the Bison executable that generated this parser.

See Also:
Constant Field Values

bisonSkeleton

public static final java.lang.String bisonSkeleton
Name of the skeleton that generated this parser.

See Also:
Constant Field Values

errorVerbose

public boolean errorVerbose
True if verbose error messages are enabled.


EOF

public static final int EOF
Token returned by the scanner to signal the end of its input.

See Also:
Constant Field Values

SCAN_ALIAS

public static final int SCAN_ALIAS
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_ARRAY

public static final int SCAN_ARRAY
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_ATTR

public static final int SCAN_ATTR
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_BYTE

public static final int SCAN_BYTE
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_CODE

public static final int SCAN_CODE
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_DATASET

public static final int SCAN_DATASET
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_DATA

public static final int SCAN_DATA
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_ERROR

public static final int SCAN_ERROR
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_FLOAT32

public static final int SCAN_FLOAT32
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_FLOAT64

public static final int SCAN_FLOAT64
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_GRID

public static final int SCAN_GRID
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_INT16

public static final int SCAN_INT16
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_INT32

public static final int SCAN_INT32
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_MAPS

public static final int SCAN_MAPS
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_MESSAGE

public static final int SCAN_MESSAGE
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_SEQUENCE

public static final int SCAN_SEQUENCE
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_STRING

public static final int SCAN_STRING
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_STRUCTURE

public static final int SCAN_STRUCTURE
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_UINT16

public static final int SCAN_UINT16
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_UINT32

public static final int SCAN_UINT32
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_URL

public static final int SCAN_URL
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_WORD

public static final int SCAN_WORD
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_PTYPE

public static final int SCAN_PTYPE
Token number, to be returned by the scanner.

See Also:
Constant Field Values

SCAN_PROG

public static final int SCAN_PROG
Token number, to be returned by the scanner.

See Also:
Constant Field Values

stream

protected final java.io.InputStream stream

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

YYFAIL

public static final int YYFAIL
Returned by a Bison action in order to print an error message and start error recovery. Formally deprecated in Bison 2.4.2's NEWS entry, where a plan to phase it out is discussed.

See Also:
Constant Field Values

dapdebug

protected int dapdebug
Constructor Detail

DapParser

public DapParser(DapParser.Lexer yylexer,
                 java.io.InputStream stream)
Instantiates the Bison-generated parser.

Parameters:
yylexer - The scanner that will supply tokens to the parser.

DapParser

public DapParser(java.io.InputStream stream)
Instantiates the Bison-generated parser.

Parameters:
yylexer - The scanner that will supply tokens to the parser.

DapParser

public DapParser(java.io.InputStream stream,
                 BaseTypeFactory factory)
Method Detail

getDebugStream

public final java.io.PrintStream getDebugStream()
Return the PrintStream on which the debugging output is printed.


setDebugStream

public final void setDebugStream(java.io.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.

yyerror

protected final void yyerror(java.lang.String s)

yycdebug

protected final void yycdebug(java.lang.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,
                     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

getDDSroot

public DDS getDDSroot()

getDASroot

public DAS getDASroot()

Dataset

public void Dataset(DDS dds,
                    BaseTypeFactory factory)
             throws ParseException,
                    DDSException
Throws:
ParseException
DDSException

Attributes

public void Attributes(DAS das)
                throws ParseException
Throws:
ParseException

Errorbody

public void Errorbody()
               throws ParseException
Throws:
ParseException