info.bliki.wiki.template.expr
Class Parser

java.lang.Object
  extended by info.bliki.wiki.template.expr.Scanner
      extended by info.bliki.wiki.template.expr.Parser

public class Parser
extends Scanner

Create an expression of the ASTNode class-hierarchy from a math formulas string representation See Operator-precedence parser for the idea, how to parse the operators depending on their precedence.


Field Summary
 
Fields inherited from class info.bliki.wiki.template.expr.Scanner
fCurrentChar, fCurrentColumnStartPosition, fCurrentPosition, fFactory, fInputString, fOperatorString, fOperList, fToken, numFormat, rowCount, TT_CONSTANT, TT_DIGIT, TT_EOF, TT_FLOATING_POINT, TT_OPERATOR, TT_PRECEDENCE_CLOSE, TT_PRECEDENCE_OPEN
 
Constructor Summary
Parser()
           
Parser(boolean relaxedSyntax)
           
Parser(IParserFactory factory, boolean relaxedSyntax)
           
 
Method Summary
 IParserFactory getFactory()
           
 ASTNode parse(java.lang.String expression)
          Parse the given expression String into an ASTNode.
 void setFactory(IParserFactory factory)
           
 
Methods inherited from class info.bliki.wiki.template.expr.Scanner
getIdentifier, getNextToken, getNumberString, getOperator, getStringBuffer, initialize, throwSyntaxError, throwSyntaxError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser()

Parser

public Parser(boolean relaxedSyntax)
       throws SyntaxError
Throws:
SyntaxError

Parser

public Parser(IParserFactory factory,
              boolean relaxedSyntax)
       throws SyntaxError
Throws:
SyntaxError
Method Detail

setFactory

public void setFactory(IParserFactory factory)

getFactory

public IParserFactory getFactory()

parse

public ASTNode parse(java.lang.String expression)
              throws SyntaxError
Parse the given expression String into an ASTNode.

Parameters:
expression - a formula string which should be parsed.
Returns:
the parsed ASTNode representation of the given formula string
Throws:
SyntaxError


Copyright © 2012 Java Wikipedia API (Bliki engine). All Rights Reserved.