public void Visit(LessThanNode node)
 {
     BinaryOperator(
         node, "<",
         () => VariableType.BOOLEAN,
         new List<VariableType> { VariableType.INTEGER, VariableType.STRING, VariableType.BOOLEAN });
 }
Ejemplo n.º 2
0
        public void Visit(LessThanNode node)
        {
            node.Children[0].Accept(this);
            node.Children[1].Accept(this);

            switch (node.Children[0].NodeType())
            {
                case VariableType.INTEGER:
                    Emit(Bytecode.IS_LESS_INT);
                    break;
                case VariableType.STRING:
                    Emit(Bytecode.IS_LESS_STRING);
                    break;
                case VariableType.BOOLEAN:
                    Emit(Bytecode.IS_LESS_BOOLEAN);
                    break;
                default:
                    throw new InternalCompilerError("Invalid node type for LessThan node");

            }
        }