KumiScript/interpreter/expression/Expression.cs

70 lines
No EOL
1.7 KiB
C#

namespace KumiScript.Interpreter
{
public class Expression
{
public virtual Expression Eval(Environment env)
{
return this;
}
public virtual decimal GetValueAsFloat()
{
throw new InterpreterTypingException();
}
public virtual Expression Car()
{
throw new InterpreterTypingException();
}
public virtual Expression Cdr()
{
throw new InterpreterTypingException();
}
public virtual ProperListExpression Cons(Expression expr)
{
throw new InterpreterTypingException();
}
public virtual ProperListExpression AppendToList(Expression expr)
{
List<Expression> el = new List<Expression>(2)
{
this,
expr
};
return new ProperListExpression(el);
}
public virtual List<Expression> EvalMembers(Environment env)
{
throw new InterpreterTypingException();
}
public virtual List<Expression> GetMembers()
{
throw new InterpreterTypingException();
}
public virtual Symbol GetSymbol()
{
throw new InterpreterTypingException();
}
public virtual Expression Apply(Expression operand, Environment env)
{
throw new InterpreterTypingException();
}
public virtual bool IsPrimitive()
{
throw new InterpreterTypingException();
}
public virtual bool Equals (Expression expr)
{
return ReferenceEquals(this, expr);
}
}
}