Module com.maroontress.intexpr
Package com.maroontress.intexpr.impl
package com.maroontress.intexpr.impl
This package provides the implementation that must not be exported outside
the module.
-
ClassDescriptionThis class provides a tiny compiler that translates code written in the little language into
Instruction
s that theInterpreter
class can execute.This class provides the instruction that places an integer constant (as an operand) to a stack.The exception that theInterpreter
throws when there is an attempt to divide an integer value by zero.The code that each operator executes.The instruction that theInterpreter
runs.A function representing operation with a binary operator.A tiny interpreter that is an implementation of a stack machine, retrieves instructions from an iterator, and executes them.A function representing operation with a unary operator.Provides messages for exceptions thatCompiler
andInterpreter
throw.Provides constants of opcodes to visualize the syntax tree.This interface provides the factory of anExecutable
object.This class provides the utility methods for operations.The instruction that pops the operand(s) from the stack, executes the function with the operand(s), and pushes the return value to the stack.This class provides the class objects of operators.This class represents the types of operators.The exception that theInterpreter
throws when an arithmetic operation results in an overflow.This interface represents the operator wrapper temporally created while theCompiler
creates the list ofInstruction
objects in Reverse Polish notation.This class represents the tree ofSyntaxNode
to visualize instructions in Reverse Polish notation.