/** * {@inheritDoc} Creates a new ASTNode object. */ @Override public FunctionNode createFunction( final SymbolNode head ) { return new FunctionNode( head ); }
@Override public ASTNode createFunction(final INodeParserFactory factory, final ASTNode lhs, final ASTNode rhs) { if (rhs instanceof FunctionNode) { FunctionNode r = (FunctionNode) rhs; if (r.size() == 3) { if (r.get(0).equals(factory.createSymbol("Set"))) { return factory.createFunction(factory.createSymbol("TagSet"), lhs, r.get(1), r.get(2)); } else if (r.get(0).equals(factory.createSymbol("SetDelayed"))) { return factory.createFunction(factory.createSymbol("TagSetDelayed"), lhs, r.get(1), r.get(2)); } } } return factory.createFunction(factory.createSymbol("TagSet"), lhs, rhs); } }
public ASTNode createFunction(final IParserFactory factory, final ASTNode lhs, final ASTNode rhs) { if (rhs instanceof IntegerNode) { if (lhs instanceof IntegerNode) { return new FractionNode((IntegerNode) lhs, (IntegerNode) rhs); } return factory.createFunction(factory.createSymbol("Times"), lhs, new FractionNode(IntegerNode.C1, (IntegerNode) rhs)); } return factory.createFunction(factory.createSymbol("Times"), lhs, factory.createFunction(factory.createSymbol("Power"), rhs, factory.createInteger(-1))); } }
public int hashCode() { if (fSymbol != null) { return fSymbol.hashCode(); } return 11; }
/** * {@inheritDoc} Creates a new ASTNode object. */ @Override public FractionNode createFraction( final IntegerNode numerator, final IntegerNode denominator ) { return new FractionNode( numerator, denominator ); }
/** * {@inheritDoc} Creates a new ASTNode object. */ @Override public ASTNode createDouble( final String doubleString ) { return new FloatNode( doubleString ); }
/** * {@inheritDoc} Creates a new ASTNode object. */ @Override public SymbolNode createSymbol( final String symbolName ) { return new SymbolNode( symbolName ); }
/** * {@inheritDoc} Creates a new ASTNode object. */ @Override public IntegerNode createInteger( final String integerString, final int numberFormat ) { return new IntegerNode( integerString, numberFormat ); }
@Override public int hashCode() { return super.hashCode()*43; } }
/** * Creates a new list with no arguments from the given header object . */ public FunctionNode createAST(final ASTNode headExpr) { return new FunctionNode(headExpr); }
/** * Hash code. * * @return the int */ @Override public int hashCode() { if ( fSymbol != null ) { fSymbol.hashCode(); } return 0; }
/** * {@inheritDoc} Creates a new list with no arguments from the given header * object . */ @Override public FunctionNode createAST( final ASTNode headExpr ) { return new FunctionNode( headExpr ); }
public int hashCode() { if (fSymbol != null) { return fSymbol.hashCode() * 41; } return 19; } }
@Override public FunctionNode createFunction(final SymbolNode head, final ASTNode arg1, final ASTNode arg2, final ASTNode arg3) { return new FunctionNode(head, arg1, arg2, arg3); }