info.bliki.wiki.template.expr.ast
Interface IParserFactory

All Known Implementing Classes:
ASTNodeFactory

public interface IParserFactory

Factory for creating the ASTNodes from the parser


Field Summary
static java.lang.String DEFAULT_OPERATOR_CHARACTERS
          The default set of characters, which could form an operator
 
Method Summary
 FunctionNode createAST(ASTNode headExpr)
          Creates a new function with no arguments from the given header expression .
 ASTNode createDouble(java.lang.String doubleString)
          Create an double node from the given double value string
 FractionNode createFraction(IntegerNode numerator, IntegerNode denominator)
          Create a "fractional" number
 FunctionNode createFunction(SymbolNode head)
          Creates a new function with head head and 0 arguments.
 FunctionNode createFunction(SymbolNode head, ASTNode arg0)
          Creates a new function with head head and 1 argument.
 FunctionNode createFunction(SymbolNode head, ASTNode arg0, ASTNode arg1)
          Creates a new function with head head and 2 arguments.
 IntegerNode createInteger(int integerValue)
          Create an integer node from the given value
 IntegerNode createInteger(java.lang.String integerString, int numberFormat)
          Create an integer node from the given string
 StringNode createString(java.lang.StringBuffer buffer)
          Create a string node from the scanned double quoted string
 SymbolNode createSymbol(java.lang.String symbolName)
          Create a symbol from the scanned identifier string
 Operator get(java.lang.String identifier)
          Get the operator for a given identifier string like Times, Plus, Sin,...
 java.lang.String getConstantSymbol(java.lang.String symbolString)
           
 java.util.Map<java.lang.String,Operator> getIdentifier2OperatorMap()
          Get the identifier to operator map
 java.util.Map<java.lang.String,java.util.ArrayList<Operator>> getOperator2ListMap()
          Get the operator-string to possible operator-list map
 java.lang.String getOperatorCharacters()
          The set of characters, which could form an operator
 java.util.List<Operator> getOperatorList(java.lang.String operatorString)
          Get the operator-list for a given operator-string
 

Field Detail

DEFAULT_OPERATOR_CHARACTERS

static final java.lang.String DEFAULT_OPERATOR_CHARACTERS
The default set of characters, which could form an operator

See Also:
Constant Field Values
Method Detail

getOperatorCharacters

java.lang.String getOperatorCharacters()
The set of characters, which could form an operator


getIdentifier2OperatorMap

java.util.Map<java.lang.String,Operator> getIdentifier2OperatorMap()
Get the identifier to operator map

Returns:
the map which stores the Operators for a given head string like Times, Plus, Sin,...

getOperator2ListMap

java.util.Map<java.lang.String,java.util.ArrayList<Operator>> getOperator2ListMap()
Get the operator-string to possible operator-list map

Returns:
the map which stores the operator-list for a given operator string like *, +, ==...

get

Operator get(java.lang.String identifier)
Get the operator for a given identifier string like Times, Plus, Sin,...

Parameters:
identifier -
Returns:

getOperatorList

java.util.List<Operator> getOperatorList(java.lang.String operatorString)
Get the operator-list for a given operator-string

Returns:
the operator-list for a given operator string like *, +, ==...

getConstantSymbol

java.lang.String getConstantSymbol(java.lang.String symbolString)

createFunction

FunctionNode createFunction(SymbolNode head)
Creates a new function with head head and 0 arguments.


createFunction

FunctionNode createFunction(SymbolNode head,
                            ASTNode arg0)
Creates a new function with head head and 1 argument.


createFunction

FunctionNode createFunction(SymbolNode head,
                            ASTNode arg0,
                            ASTNode arg1)
Creates a new function with head head and 2 arguments.


createAST

FunctionNode createAST(ASTNode headExpr)
Creates a new function with no arguments from the given header expression .


createDouble

ASTNode createDouble(java.lang.String doubleString)
Create an double node from the given double value string

Parameters:
doubleString -
Returns:

createInteger

IntegerNode createInteger(java.lang.String integerString,
                          int numberFormat)
Create an integer node from the given string

Parameters:
integerString - the integer number represented as a String
numberFormat - the format of the number (usually 10)
Returns:
IInteger

createInteger

IntegerNode createInteger(int integerValue)
Create an integer node from the given value

Parameters:
integerValue - the integer number's value
Returns:
IInteger

createFraction

FractionNode createFraction(IntegerNode numerator,
                            IntegerNode denominator)
Create a "fractional" number

Parameters:
numerator - numerator of the fractional number
denominator - denominator of the fractional number
Returns:
IFraction

createString

StringNode createString(java.lang.StringBuffer buffer)
Create a string node from the scanned double quoted string

Parameters:
symbolName -
Returns:

createSymbol

SymbolNode createSymbol(java.lang.String symbolName)
Create a symbol from the scanned identifier string

Parameters:
symbolName -
Returns:


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