ExpressionParser

org.nlogo.parse.ExpressionParser

Parses procedure bodies.

Attributes

Source
ExpressionParser.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(procedureDeclaration: FrontEndProcedure, tokens: Iterator[Token], scope: SymbolTable): ProcedureDefinition

parses a procedure. Procedures are a bunch of statements (not a block of statements, that's something else), and so are parsed as such.

parses a procedure. Procedures are a bunch of statements (not a block of statements, that's something else), and so are parsed as such.

Attributes

Source
ExpressionParser.scala
def parseExpression(tokens: BufferedIterator[Token], variadic: Boolean, goalType: Int, scope: SymbolTable): Expression

a wrapper around parseExpressionInternal for parsing expressions in non-argument positions (basically only inside parens or reporter blocks).

a wrapper around parseExpressionInternal for parsing expressions in non-argument positions (basically only inside parens or reporter blocks).

Package protected for unit testing.

Value parameters

tokens

the input token stream

variadic

whether to treat this expression as possibly variadic

Attributes

Source
ExpressionParser.scala
def parseMore(originalExpr: Expression, tokens: BufferedIterator[Token], precedence: Int, scope: SymbolTable): Expression

possibly parses the rest of the current expression. Expressions are parsed in a slightly strange way. First we parse an expr, then we look ahead to see if the next token is an infix operator. If so, we use what we've seen so far as its first arg, and then parse its other arguments. Then we repeat. The result of all of this is the actual expr.

possibly parses the rest of the current expression. Expressions are parsed in a slightly strange way. First we parse an expr, then we look ahead to see if the next token is an infix operator. If so, we use what we've seen so far as its first arg, and then parse its other arguments. Then we repeat. The result of all of this is the actual expr.

Attributes

Source
ExpressionParser.scala