public class Jasic extends Object
Modifier and Type | Class and Description |
---|---|
class |
Jasic.AssignStatement
An assignment statement evaluates an expression and stores the result in
a variable.
|
static interface |
Jasic.Expression
Base interface for an expression.
|
class |
Jasic.GotoStatement
A "goto" statement jumps execution to another place in the program.
|
class |
Jasic.IfThenStatement
An if then statement jumps execution to another place in the program, but
only if an expression evaluates to something other than 0.
|
class |
Jasic.InputStatement
An "input" statement reads input from the user and stores it in a
variable.
|
class |
Jasic.NumberValue
A numeric value.
|
class |
Jasic.OperatorExpression
An operator expression evaluates two expressions and then performs some
arithmetic operation on the results.
|
class |
Jasic.PrintStatement
A "print" statement evaluates an expression, converts the result to a
string, and displays it to the user.
|
static interface |
Jasic.Statement
Base interface for a Jasic statement.
|
class |
Jasic.StringValue
A string value.
|
static interface |
Jasic.Value
This is the base interface for a value.
|
class |
Jasic.VariableExpression
A variable expression evaluates to the current value stored in that
variable.
|
Constructor and Description |
---|
Jasic()
Constructs a new Jasic instance.
|
Modifier and Type | Method and Description |
---|---|
void |
interpret(String source)
This is where the magic happens.
|
static void |
main(String[] args)
Runs the interpreter as a command-line app.
|
public Jasic()
public static void main(String[] args)
args
- Command-line arguments.public void interpret(String source)
source
- A string containing the source code of a .jas script to
interpret.Copyright © 2017. All Rights Reserved.