org.nlogo.compile.api

Members list

Type members

Classlikes

trait Application extends AstNode

represents an application, in the abstract (either a reporter application of a command application). This is used when parsing arguments, when we don't care what kind of application the args are for.

represents an application, in the abstract (either a reporter application of a command application). This is used when parsing arguments, when we don't care what kind of application the args are for.

Attributes

Source
AstNode.scala
Supertypes
trait AstNode
trait AstNode
class Object
trait Matchable
class Any
Show all
Known subtypes
class ReporterApp
class Statement
trait AstFolder[A]

Attributes

Source
AstVisitor.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait AstNode extends AstNode

An interface representing a node in the NetLogo abstract syntax tree (AKA parse tree, in NetLogo's case).

An interface representing a node in the NetLogo abstract syntax tree (AKA parse tree, in NetLogo's case).

Each AstNode, even if synthesized, should correspond to some particular source fragment, as indicated by the position and length. It's the compiler's job to make sure these values are always reasonable.

Attributes

Source
AstNode.scala
Supertypes
trait AstNode
class Object
trait Matchable
class Any
Known subtypes
trait Application
class ReporterApp
class Statement
trait Expression
class CodeBlock
class CommandBlock
class Statements
Show all

Transforms an AST to allow changes without mutation

Transforms an AST to allow changes without mutation

Attributes

Source
AstVisitor.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait AstVisitor

an interface for AST tree-walkers. This represents the usual Visitor pattern with double-dispatch.

an interface for AST tree-walkers. This represents the usual Visitor pattern with double-dispatch.

Attributes

Source
AstVisitor.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Source
Interfaces.scala
Supertypes
class Object
trait Matchable
class Any
trait Backifier

Attributes

Source
Backifier.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Backifier
class BlockMatch(val node: AstNode) extends Match

Attributes

Source
PrimitiveMungers.scala
Supertypes
trait Match
class Object
trait Matchable
class Any
class CodeBlock(val code: String, val sourceLocation: SourceLocation) extends Expression

represents a set of code that should not be evaluated, but can be lexed and tokenized. This is an expression, and can be used as an argument to commands and reports.

represents a set of code that should not be evaluated, but can be lexed and tokenized. This is an expression, and can be used as an argument to commands and reports.

Attributes

Source
AstNode.scala
Supertypes
trait Expression
trait AstNode
trait AstNode
class Object
trait Matchable
class Any
Show all
class CommandBlock(val statements: Statements, val sourceLocation: SourceLocation) extends Expression

represents a block containing zero or more statements. Called a command block rather than a statement block for consistency with usual NetLogo jargon. Note that this is an Expression, and as such can be an argument to commands and reporters, etc.

represents a block containing zero or more statements. Called a command block rather than a statement block for consistency with usual NetLogo jargon. Note that this is an Expression, and as such can be an argument to commands and reporters, etc.

Attributes

Source
AstNode.scala
Supertypes
trait Expression
trait AstNode
trait AstNode
class Object
trait Matchable
class Any
Show all
class CommandMatch(val node: Statement) extends Match

Attributes

Source
PrimitiveMungers.scala
Supertypes
trait Match
class Object
trait Matchable
class Any
trait CommandMunger extends OptimizeMunger[Statement, Command]

Attributes

Source
PrimitiveMungers.scala
Supertypes
trait OptimizeMunger[Statement, Command]
class Object
trait Matchable
class Any
Known subtypes
object CroFast
object CrtFast
object Fd1
object FdLessThan1
object HatchFast
object SproutFast
Show all

The default AST tree-walker. This simply visits each node of the tree, and visits any children of each node in turn. Subclasses can implement pre-order or post-order traversal, or a wide range of other strategies.

The default AST tree-walker. This simply visits each node of the tree, and visits any children of each node in turn. Subclasses can implement pre-order or post-order traversal, or a wide range of other strategies.

Attributes

Source
AstVisitor.scala
Supertypes
trait AstVisitor
class Object
trait Matchable
class Any
Known subtypes
trait Expression extends AstNode

represents a NetLogo expression. An expression is either a block or a reporter application (variable references and constants (including lists), are turned into reporter applications).

represents a NetLogo expression. An expression is either a block or a reporter application (variable references and constants (including lists), are turned into reporter applications).

Attributes

Source
AstNode.scala
Supertypes
trait AstNode
trait AstNode
class Object
trait Matchable
class Any
Show all
Known subtypes

Attributes

Source
Interfaces.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Match

Attributes

Companion
trait
Source
PrimitiveMungers.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Match.type
trait Match

Attributes

Companion
object
Source
PrimitiveMungers.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Source
Interfaces.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object MiddleEnd
object Optimizations

Attributes

Companion
class
Source
Optimizations.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Optimizations(commandOptimizations: Seq[CommandMunger], reporterOptimizations: Seq[ReporterMunger])

Attributes

Companion
object
Source
Optimizations.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait OptimizeMunger[-A <: AstNode, +B <: Instruction]

Attributes

Source
PrimitiveMungers.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object CroFast
object CrtFast
object Fd1
object FdLessThan1
object HatchFast
object SproutFast
object AnyBreedOn
object AnyOther
object AnyOtherWith
object AnyTurtlesOn
object AnyWith1
object AnyWith2
object AnyWith3
object AnyWith4
object AnyWith5
object CountOther
object CountWith
object HasEqual
object HasLessThan
object HasNotEqual
object Nsum
object Nsum4
object OneOfWith
object OtherWith
object PatchAt
object RandomConst
object With
object WithOther
Show all
class ProcedureDefinition(val procedure: Procedure, val statements: Statements) extends AstNode

represents a single procedure definition. really just a container for the procedure body, which is a Statements object.

represents a single procedure definition. really just a container for the procedure body, which is a Statements object.

Attributes

Source
AstNode.scala
Supertypes
trait AstNode
trait AstNode
class Object
trait Matchable
class Any
Show all
class ReporterApp(var coreReporter: Reporter, var reporter: Reporter, _args: Buffer[Expression], val sourceLocation: SourceLocation) extends Expression, Application

represents a reporter application. This is the typical kind of NetLogo expression, things like "round 5" and "3 + 4". However, this class also represents things like constants, which are converted into no-arg reporter applications as they're parsed.

represents a reporter application. This is the typical kind of NetLogo expression, things like "round 5" and "3 + 4". However, this class also represents things like constants, which are converted into no-arg reporter applications as they're parsed.

Attributes

Companion
object
Source
AstNode.scala
Supertypes
trait Application
trait Expression
trait AstNode
trait AstNode
class Object
trait Matchable
class Any
Show all
object ReporterApp

Attributes

Companion
class
Source
AstNode.scala
Supertypes
class Object
trait Matchable
class Any
Self type
class ReporterAppMatch(val node: ReporterApp) extends Match

Attributes

Source
PrimitiveMungers.scala
Supertypes
trait Match
class Object
trait Matchable
class Any
class ReporterBlock(val app: ReporterApp, val sourceLocation: SourceLocation) extends Expression

represents a block containing exactly one expression. Called a reporter block rather than an expression block for consistency with usual NetLogo jargon. Note that this is an Expression, and as such can be an argument to commands and reporters, etc. However, it is a different expression from the expression it contains... Its "blockness" is significant.

represents a block containing exactly one expression. Called a reporter block rather than an expression block for consistency with usual NetLogo jargon. Note that this is an Expression, and as such can be an argument to commands and reporters, etc. However, it is a different expression from the expression it contains... Its "blockness" is significant.

Attributes

Source
AstNode.scala
Supertypes
trait Expression
trait AstNode
trait AstNode
class Object
trait Matchable
class Any
Show all

Attributes

Source
PrimitiveMungers.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AnyBreedOn
object AnyOther
object AnyOtherWith
object AnyTurtlesOn
object AnyWith1
object AnyWith2
object AnyWith3
object AnyWith4
object AnyWith5
object CountOther
object CountWith
object HasEqual
object HasLessThan
object HasNotEqual
object Nsum
object Nsum4
object OneOfWith
object OtherWith
object PatchAt
object RandomConst
object With
object WithOther
Show all

Attributes

Source
PrimitiveMungers.scala
Supertypes
trait OptimizeMunger[Statement, Command]
class Object
trait Matchable
class Any
Known subtypes
object CroFast
object CrtFast
object Fd1
object FdLessThan1
object HatchFast
object SproutFast
Show all

Attributes

Source
PrimitiveMungers.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AnyBreedOn
object AnyOther
object AnyOtherWith
object AnyTurtlesOn
object AnyWith1
object AnyWith2
object AnyWith3
object AnyWith4
object AnyWith5
object CountOther
object CountWith
object HasEqual
object HasLessThan
object HasNotEqual
object Nsum
object Nsum4
object OneOfWith
object OtherWith
object PatchAt
object RandomConst
object With
object WithOther
Show all
class Statement(val coreCommand: Command, var command: Command, _args: Buffer[Expression], val sourceLocation: SourceLocation) extends Application

represents a NetLogo statement. Statements only have one form: command application.

represents a NetLogo statement. Statements only have one form: command application.

Attributes

Source
AstNode.scala
Supertypes
trait Application
trait AstNode
trait AstNode
class Object
trait Matchable
class Any
Show all
class Statements(var stmts: Seq[Statement], var sourceLocation: SourceLocation) extends AstNode

represents a chunk of zero or more NetLogo statements. Note that this is not necessarily a "block" of statements, as block means something specific (enclosed in [], in particular). This class is used to represent other groups of statements as well, for instance procedure bodies.

represents a chunk of zero or more NetLogo statements. Note that this is not necessarily a "block" of statements, as block means something specific (enclosed in [], in particular). This class is used to represent other groups of statements as well, for instance procedure bodies.

Attributes

Source
AstNode.scala
Supertypes
trait AstNode
trait AstNode
class Object
trait Matchable
class Any
Show all