dods.dap.parser
Class ExprParser

java.lang.Object
  extended by dods.dap.parser.ExprParser
All Implemented Interfaces:
ExprParserConstants

public class ExprParser
extends Object
implements ExprParserConstants

The constraint expression parser class.

Because it only makes sense to evaluate CEs when serving data, the BaseTyeFactory must create instances of the SDtype classes, not the Dtype classes. The is because we use the setRead method of the class ServerMethods when creating constants (to ensure that the evaluator doesn't try to read tem from the dataset!).

Author:
jhrg

Field Summary
 Token jj_nt
           
 boolean lookingAhead
           
 Token token
           
 ExprParserTokenManager token_source
           
 
Fields inherited from interface dods.dap.parser.ExprParserConstants
AMPERSAND, ASTERISK, COLON, COMMA, DEFAULT, EOF, EQUAL, EXPONENT, FLOAT, GREATER, GREATER_EQL, ID, INT, LBRACE, LBRACKET, LESS, LESS_EQL, LPAREN, MANTISSA, NOT_EQUAL, QUOTED_STR, RBRACE, RBRACKET, REGEXP, RPAREN, SEPARATOR, STR, tokenImage, UNQUOTED_STR, UNTERM_QUOTE
 
Constructor Summary
ExprParser(ExprParserTokenManager tm)
           
ExprParser(InputStream stream)
           
ExprParser(Reader stream)
           
 
Method Summary
 Vector arg_list()
           
 void array_index(int count, ServerArrayMethods bt)
           
 Clause bool_function()
           
 Clause clause()
           
 Stack component(Stack components)
           
 dods.dap.BaseType constant()
           
 void constraint_expression(CEEvaluator ceEval, dods.dap.BaseTypeFactory factory, ClauseFactory clauseFactory)
          This is the entry point for the Constraint expression parser.
 void disable_tracing()
           
 void enable_tracing()
           
 String field()
           
 ParseException generateParseException()
           
 Token getNextToken()
           
 Token getToken(int index)
           
 void proj_clause()
           
 void proj_variable()
           
 void projection()
           
 void ReInit(ExprParserTokenManager tm)
           
 void ReInit(InputStream stream)
           
 void ReInit(Reader stream)
           
 int rel_op()
           
 void selection()
           
 SubClause value()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public ExprParserTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

ExprParser

public ExprParser(InputStream stream)

ExprParser

public ExprParser(Reader stream)

ExprParser

public ExprParser(ExprParserTokenManager tm)
Method Detail

constraint_expression

public final void constraint_expression(CEEvaluator ceEval,
                                        dods.dap.BaseTypeFactory factory,
                                        ClauseFactory clauseFactory)
                                 throws ParseException,
                                        dods.dap.NoSuchVariableException,
                                        dods.dap.NoSuchFunctionException,
                                        InvalidOperatorException,
                                        dods.dap.DODSException,
                                        InvalidParameterException,
                                        SBHException,
                                        WrongTypeException
This is the entry point for the Constraint expression parser.

Note that this method catches any ParserException and recasts it to a DODSException after replacing all double quotes with single quotes.

Parameters:
ceEval - A CEEvaluator instance where any select clauses will be dumped and from which the DDS, which supplies the evaluation environment, will be read.
factory - A BaseTypeFactory used to generate instances of variables as needed (e.g., to hold values of constants).
clauseFactory - A ClauseFactory used to generate instances of each type of clause.
Throws:
ParseException
dods.dap.NoSuchVariableException
dods.dap.NoSuchFunctionException
InvalidOperatorException
dods.dap.DODSException
InvalidParameterException
SBHException
WrongTypeException

selection

public final void selection()
                     throws ParseException,
                            dods.dap.NoSuchVariableException,
                            dods.dap.NoSuchFunctionException,
                            InvalidOperatorException,
                            ParseException,
                            SBHException,
                            dods.dap.DODSException
Throws:
ParseException
dods.dap.NoSuchVariableException
dods.dap.NoSuchFunctionException
InvalidOperatorException
SBHException
dods.dap.DODSException

clause

public final Clause clause()
                    throws ParseException,
                           dods.dap.NoSuchVariableException,
                           dods.dap.NoSuchFunctionException,
                           InvalidOperatorException,
                           ParseException,
                           dods.dap.DODSException
Throws:
ParseException
dods.dap.NoSuchVariableException
dods.dap.NoSuchFunctionException
InvalidOperatorException
dods.dap.DODSException

bool_function

public final Clause bool_function()
                           throws ParseException,
                                  dods.dap.NoSuchVariableException,
                                  dods.dap.NoSuchFunctionException,
                                  InvalidOperatorException,
                                  ParseException,
                                  dods.dap.DODSException
Throws:
ParseException
dods.dap.NoSuchVariableException
dods.dap.NoSuchFunctionException
InvalidOperatorException
dods.dap.DODSException

rel_op

public final int rel_op()
                 throws ParseException
Throws:
ParseException

projection

public final void projection()
                      throws ParseException,
                             dods.dap.NoSuchVariableException,
                             dods.dap.NoSuchFunctionException,
                             InvalidOperatorException,
                             ParseException,
                             InvalidParameterException,
                             SBHException,
                             WrongTypeException,
                             dods.dap.DODSException
Throws:
ParseException
dods.dap.NoSuchVariableException
dods.dap.NoSuchFunctionException
InvalidOperatorException
InvalidParameterException
SBHException
WrongTypeException
dods.dap.DODSException

proj_clause

public final void proj_clause()
                       throws ParseException,
                              dods.dap.NoSuchVariableException,
                              dods.dap.NoSuchFunctionException,
                              InvalidOperatorException,
                              ParseException,
                              InvalidParameterException,
                              SBHException,
                              WrongTypeException,
                              dods.dap.DODSException
Throws:
ParseException
dods.dap.NoSuchVariableException
dods.dap.NoSuchFunctionException
InvalidOperatorException
InvalidParameterException
SBHException
WrongTypeException
dods.dap.DODSException

proj_variable

public final void proj_variable()
                         throws ParseException,
                                dods.dap.NoSuchVariableException,
                                dods.dap.NoSuchFunctionException,
                                InvalidOperatorException,
                                ParseException,
                                InvalidParameterException,
                                SBHException,
                                WrongTypeException,
                                dods.dap.DODSException
Throws:
ParseException
dods.dap.NoSuchVariableException
dods.dap.NoSuchFunctionException
InvalidOperatorException
InvalidParameterException
SBHException
WrongTypeException
dods.dap.DODSException

component

public final Stack component(Stack components)
                      throws ParseException,
                             ParseException,
                             dods.dap.DODSException
Throws:
ParseException
dods.dap.DODSException

arg_list

public final Vector arg_list()
                      throws ParseException,
                             dods.dap.NoSuchVariableException,
                             dods.dap.NoSuchFunctionException,
                             InvalidOperatorException,
                             ParseException,
                             dods.dap.DODSException
Throws:
ParseException
dods.dap.NoSuchVariableException
dods.dap.NoSuchFunctionException
InvalidOperatorException
dods.dap.DODSException

array_index

public final void array_index(int count,
                              ServerArrayMethods bt)
                       throws ParseException,
                              ParseException,
                              dods.dap.DODSException,
                              InvalidParameterException,
                              SBHException
Throws:
ParseException
dods.dap.DODSException
InvalidParameterException
SBHException

value

public final SubClause value()
                      throws ParseException,
                             dods.dap.NoSuchVariableException,
                             dods.dap.NoSuchFunctionException,
                             InvalidOperatorException,
                             dods.dap.DODSException,
                             ParseException
Throws:
ParseException
dods.dap.NoSuchVariableException
dods.dap.NoSuchFunctionException
InvalidOperatorException
dods.dap.DODSException

field

public final String field()
                   throws ParseException,
                          ParseException
Throws:
ParseException

constant

public final dods.dap.BaseType constant()
                                 throws ParseException,
                                        dods.dap.DODSException,
                                        ParseException
Throws:
ParseException
dods.dap.DODSException

ReInit

public void ReInit(InputStream stream)

ReInit

public void ReInit(Reader stream)

ReInit

public void ReInit(ExprParserTokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public final ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()