ru.biosoft.math.model
Class AstFunctionDeclaration
ru.biosoft.math.model.SimpleNode
|
+--ru.biosoft.math.model.AstFunctionDeclaration
- public class AstFunctionDeclaration
- extends SimpleNode
- implements Function, ParserContext
Function declaration, it corresponds lambda element in MathML.
Function declaration syntax is following:
FunctionDeclaration ::= ( "function" Identifier "(" ArgumentDeclaration ( "," ArgumentDeclaration )* ")" Expression )
Example:
function f(x, y) = sin(x) + cos(y);
Parser contex issues:
Linear parser checks whether the function uses declared variables, for this purpose it uses its
own parser context.
| Methods inherited from class ru.biosoft.math.model.SimpleNode |
dump, dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtReplaceChild, jjtSetParent, toString |
AstFunctionDeclaration
public AstFunctionDeclaration(int id)
containsConstant
public boolean containsConstant(String name)
containsVariable
public boolean containsVariable(String name)
declareConstant
public void declareConstant(String name, Object value)
declareFunction
public void declareFunction(Function function)
declareVariable
public void declareVariable(String name, Object value)
getConstantValue
public Object getConstantValue(String name)
getFunction
public Function getFunction(String name)
getName
public String getName()
getNumberOfParameters
public int getNumberOfParameters()
getPriority
public int getPriority()
getVariableValue
public Object getVariableValue(String name)
init
public void init(ParserContext parent)
setName
public void setName(String name)
toString
public String toString()
to Class java.lang.String- Function name.
to Class ru.biosoft.math.model.ParserContext
to Class java.util.HashMap
BOTTOM