opendap.dap.parsers
Class DapParser

java.lang.Object
  extended by opendap.dap.parsers.Dapparse
      extended by opendap.dap.parsers.DapParser

public class DapParser
extends Dapparse

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 String bisonSkeleton
          Name of the skeleton that generated this parser.
static String bisonVersion
          Version number for the Bison executable that generated this parser.
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.
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.
 
Fields inherited from class opendap.dap.parsers.Dapparse
DapDAS, DapDDS, dapdebug, DapERR, DapNUL
 
Constructor Summary
DapParser(BaseTypeFactory factory)
          Instantiates the Bison-generated parser.
DapParser(DapParser.Lexer yylexer)
          Instantiates the Bison-generated parser.
 
Method Summary
 int getDebugLevel()
          Answer the verbosity of the debugging output; 0 means that all kinds of output from the parser are suppressed.
 PrintStream getDebugStream()
          Return the PrintStream on which the debugging output is printed.
 String getURL()
           
 boolean parse()
          Parse input from the scanner that was specified at object construction time.
 boolean parse(InputStream stream)
          **********************************************
 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(PrintStream s)
          Set the PrintStream on which the debug output is printed.
 void setURL(String url)
           
protected  void yycdebug(String s)
           
protected  void yyerror(String s)
           
 
Methods inherited from class opendap.dap.parsers.Dapparse
dapparse, dasparse, ddsparse, errparse, getDAS, getDDS, getERR
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

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

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
Constructor Detail

DapParser

public DapParser(DapParser.Lexer yylexer)
Instantiates the Bison-generated parser.

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

DapParser

public DapParser(BaseTypeFactory factory)
Instantiates the Bison-generated parser.

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

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:
getDebugLevel in class Dapparse

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:
setDebugLevel in class Dapparse
Parameters:
level - The verbosity level for debugging output.

yyerror

protected final void yyerror(String s)

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,
                     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

parse

public boolean parse(InputStream stream)
              throws ParseException
Description copied from class: Dapparse
**********************************************

Specified by:
parse in class Dapparse
Throws:
ParseException

setURL

public void setURL(String url)
Specified by:
setURL in class Dapparse

getURL

public String getURL()
Specified by:
getURL in class Dapparse


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.