ElegantJ Data Tables Java API Specification v1.1

com.elegantj.data.parser
Class Parser

java.lang.Object
  extended bycom.elegantj.data.parser.Parser
All Implemented Interfaces:
com.elegantj.data.parser.SharedConstants

public class Parser
extends java.lang.Object
implements com.elegantj.data.parser.SharedConstants

The Parser class parses the buffer string.
This is the recursive decent parser for mathematical expressions and functions. It will also parses the database related expressions and functions. It uses the scanner class to recognize tokens and creates a tree of the parsed expression/functions out of nodes. Results a value from the parsed tree


Field Summary
static int stError
          A constant used for representing the scanning error status
static int stOk
          A constant used for representing the scanning ok status
static int stQuit
          A constant used for representing the scanning quit status
static int tAnd
          A constant used for representing the logical and operation
static int tAssign
          A constant used for representing the assigning operation
static int tCharacter
          A constant used for representing the character
static int tCom
          A constant used for representing the arguments in the symbolic operation
static int tDivide
          A constant used for representing the dividing operation
static int tDouble
          A constant used for representing the double
static int tEnd
          A constant used for representing the scanning end status
static int tEqual
          A constant used for representing the equal to operator in the comparing operation
static int tError
          A constant used for representing the scanning error status
static int tGreater
          A constant used for representing the greater then operator in the comparing operation
static int tGreaterEqual
          A constant used for representing the greater then or equals to operator in the comparing operation
static int tIdent
          A constant used for representing the symbolic operation
static int tInteger
          A constant used for representing the integer
static int tLess
          A constant used for representing the less then operator in the comparing operation
static int tLessEqual
          A constant used for representing the less then or equal to operator in the comparing operation
static int tLParen
          A constant used for representing the left parenthesis
static int tMinus
          A constant used for representing the substracting operation
static int tMult
          A constant used for representing the multiplying operation
static int tNotEqual
          A constant used for representing the not equal to operator in the comparing operation
static int tOr
          A constant used for representing the logical or operation
static int tPlus
          A constant used for representing the adding operation
static int tPow
          A constant used for representing the powering operation
static int tRParen
          A constant used for representing the right parenthesis
static int tStart
          A constant used for representing the scanning start status
static int tString
          A constant used for representing the string
 
Constructor Summary
Parser(Scanner scanner_in, SymbolTable symTab_in, FunctionTable funTab_in)
          Creates a Parser with specified scanned, symbol table and function table.
 
Method Summary
 java.lang.String getOutputString()
          Returns the output string representing scanned buffer
 java.lang.Object getResult()
          Returns the result from the tree of the parsed expressions and functions out of nodes
 java.lang.String getStatus()
          Returns the current scanning status
 void parse()
          Starts the parsing and sets tree equal to the top of the created tree
 void reset()
          Resets the buffer to be parsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stOk

public static final int stOk
A constant used for representing the scanning ok status

See Also:
Constant Field Values

stQuit

public static final int stQuit
A constant used for representing the scanning quit status

See Also:
Constant Field Values

stError

public static final int stError
A constant used for representing the scanning error status

See Also:
Constant Field Values

tStart

public static final int tStart
A constant used for representing the scanning start status

See Also:
Constant Field Values

tEnd

public static final int tEnd
A constant used for representing the scanning end status

See Also:
Constant Field Values

tError

public static final int tError
A constant used for representing the scanning error status

See Also:
Constant Field Values

tPlus

public static final int tPlus
A constant used for representing the adding operation

See Also:
Constant Field Values

tMult

public static final int tMult
A constant used for representing the multiplying operation

See Also:
Constant Field Values

tDivide

public static final int tDivide
A constant used for representing the dividing operation

See Also:
Constant Field Values

tMinus

public static final int tMinus
A constant used for representing the substracting operation

See Also:
Constant Field Values

tLParen

public static final int tLParen
A constant used for representing the left parenthesis

See Also:
Constant Field Values

tRParen

public static final int tRParen
A constant used for representing the right parenthesis

See Also:
Constant Field Values

tAssign

public static final int tAssign
A constant used for representing the assigning operation

See Also:
Constant Field Values

tPow

public static final int tPow
A constant used for representing the powering operation

See Also:
Constant Field Values

tIdent

public static final int tIdent
A constant used for representing the symbolic operation

See Also:
Constant Field Values

tCom

public static final int tCom
A constant used for representing the arguments in the symbolic operation

See Also:
Constant Field Values

tAnd

public static final int tAnd
A constant used for representing the logical and operation

See Also:
Constant Field Values

tOr

public static final int tOr
A constant used for representing the logical or operation

See Also:
Constant Field Values

tLess

public static final int tLess
A constant used for representing the less then operator in the comparing operation

See Also:
Constant Field Values

tGreater

public static final int tGreater
A constant used for representing the greater then operator in the comparing operation

See Also:
Constant Field Values

tLessEqual

public static final int tLessEqual
A constant used for representing the less then or equal to operator in the comparing operation

See Also:
Constant Field Values

tGreaterEqual

public static final int tGreaterEqual
A constant used for representing the greater then or equals to operator in the comparing operation

See Also:
Constant Field Values

tNotEqual

public static final int tNotEqual
A constant used for representing the not equal to operator in the comparing operation

See Also:
Constant Field Values

tEqual

public static final int tEqual
A constant used for representing the equal to operator in the comparing operation

See Also:
Constant Field Values

tInteger

public static final int tInteger
A constant used for representing the integer

See Also:
Constant Field Values

tDouble

public static final int tDouble
A constant used for representing the double

See Also:
Constant Field Values

tCharacter

public static final int tCharacter
A constant used for representing the character

See Also:
Constant Field Values

tString

public static final int tString
A constant used for representing the string

See Also:
Constant Field Values
Constructor Detail

Parser

public Parser(Scanner scanner_in,
              SymbolTable symTab_in,
              FunctionTable funTab_in)
Creates a Parser with specified scanned, symbol table and function table.

Parameters:
scanner_in - the scanner used for parsing the buffer, default Scanner
symTab_in - the symbol table containing the set of symbol's names, default empty
funTab_in - the function table containing the set of function's definations, default empty
Method Detail

reset

public void reset()
Resets the buffer to be parsed


getOutputString

public java.lang.String getOutputString()
Returns the output string representing scanned buffer

Returns:
the string by adding the brackets to the scanned buffer

getStatus

public java.lang.String getStatus()
Returns the current scanning status

Returns:
the string representing the scanning status

getResult

public java.lang.Object getResult()
                           throws ParserException
Returns the result from the tree of the parsed expressions and functions out of nodes

Returns:
the value object
Throws:
ParserException

parse

public void parse()
           throws ParserException
Starts the parsing and sets tree equal to the top of the created tree

Throws:
ParserException

ElegantJ Data Tables Java API Specification v1.1

Submit a bug or feature

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjbeans.com
All Rights Reserved.