Building Parsers with Java

Package sjm.examples.sling

Class Summary
Abs This class wraps an absolute value function around another source function.
AddFunctionCommand This command, when executed, evaluates a renderable function and adds it to a renderable collection.
Arithmetic This class wraps an arithmetic function around two source functions.
AssignFunctionCommand This command, when executed, evaluates a function and sets it as the value of a variable.
AssignmentAssembler Pops a function and a variable, constructs an AssignFunctionCommand from these terms, and pushes the command.
Cartesian This class combines the y component of each of two source functions to form a new two-dimensional function.
Ceil This class wraps a ceil function around another source function.
Cos This class wraps a cos function around another source function.
Extrema This class holds onto two points, so that methods that find a maximum and minimum value over some range can return both points as a single Extrema.
Floor This class wraps a floor function around another source function.
ForAssembler Builds a "for" command from elements on the stack, which should be: a variable, a "from" function, a "to" function, a '{' token, and a series of commands.
FunctionAssembler This assembler uses information from a prototypical function object received in a constructor to guide the construction of a new function.
FunctionComparison This class's constructor accepts two functions and an operator, and can evaluate and compare the functions.
NegativeAssembler Pop the assembly, and push a new function that multiplies this function by -1.
NumAssembler Pops a number token, and pushes a number function.
PiAssembler Pushes the function (t, pi).
PlotAssembler Pops a function, and pushes an AddFunctionCommand object.
Point Objects of this class store two numbers that effectively determine a point in two-dimensional space.
Polar This class represents the location of a sling stone in terms of the length of a sling's strap, and the angle (in radians) around the slinger's head.
Random Objects of this class return a random number between 0 and 1 when asked for their value.
Renderable This class contains a Sling function and the number of lines to use in rendering the function.
RenderableCollection This class holds a collection of renderable Sling functions.
ReservedLiteral A ReservedLiteral matches a specific string that a tokenizer returns as a reserved word type.
Scale A scale represents the relationship of two temporal variables that vary linearly with each other.
ScaleAssembler This class augments the stack with default scale arguments, and then uses a FunctionAssembler with a Scale object to work on the assembly.
Scope This class holds a collection of variables.
ShowFunction Show the composition of the function sin(10*t).
Sin This class wraps a sin function around another source function.
Slider This class holds a JSlider component, and returns the the slider's value in its f(t) call.
SliderAssembler Uses one of the sliders in an assembly's target to create a Slider function, and pushes this function.
Sling This class represents the location of a sling stone in terms of the length of a sling's strap, and the speed of the stone's rotation around the slinger's head.
SlingFunction SlingFunction is an abstract class that requires subclasses to implement the method Point f(double t).
SlingIde This class provides an interactive development environment for the Sling programming language.
SlingMediator This class supports a SlingIde object, handling the interaction of the IDE's components.
SlingPanel A SlingPlanel draws a RenderableCollection.
SlingParser This class provides a parser for Sling, an imperative language that plots the path of a sling stone.
SlingTarget This class provides a target for a SlingParser .
SlingTester This class tests that class SlingParser can parse random language elements.
T This class represents time, which the Sling environment defines to vary from 0 to 1 as a plot unfolds.
Tan This class wraps a tan function around another source function.
Variable A variable is a named place that can store another function.
VariableAssembler This class looks up a variable by name, using the word on an assembly's stack, and pushes a Variable of that name.
 

Exception Summary
UnassignedVariableException Signals that a given string is not the name of a known variable.
 


by Steve Metsker