Namespace Perlang
Classes
CommonConstants
Contains common constants shared between multiple assemblies.
This mechanism serves two purposes:
- To avoid duplication of the version identifier among multiple assemblies (which would make it unnecessarily awkward to bump version numbers).
- To make it possible to retrieve the version identifier(s) programmatically, at runtime via reflection.
Expr
Expr.Assign
An assignment expression.
Expr.Binary
Expr.Call
Expr.CollectionInitializer
Expr.Empty
Expr.Get
Expr.Grouping
Expr.Identifier
Represents an identifier, such as a variable name, a function name or a class.
Expr.Index
Expr.Literal
A literal string or number.
Expr.Logical
Expr.UnaryPostfix
Represents unary postfix expressions. Examples of such expressions are i++
and j--
.
Expr.UnaryPrefix
Represents unary prefix expressions. Examples of such expressions are !flag
and -10
. Note that prefix
increment and decrement are currently not supported.
NullObject
"Null-object". This object is used in cases where we need a Type that corresponds to null values. Since typeof(null) is invalid, we need a fake construct we can use instead.
NumericToken
Parameter
PerlangClass
PerlangEnum
PerlangMode
RuntimeError
Stmt
Stmt.Block
Stmt.Class
Stmt.Enum
Stmt.ExpressionStmt
An expression statement is a statement for wrapping a single expression in statement form.
Stmt.Function
Stmt.If
Stmt.Print
Stmt.Return
Stmt.Var
Stmt.While
Token
TypeReference
A type reference is a (potentially unresolved) reference to a Perlang type.
The object is mutable.
VisitorBase
Abstract base class for expression visitors.
All the methods implemented in this class are no-op, but they do their best to try and make the whole tree be traversed. The idea is to give child classes an opportunity to only override a smaller subset of the full set of expression types, to avoid unnecessary boilerplate code.
VoidObject
Dummy type used to fulfill the requirements of the Expr.IVisitor<TR> and Stmt.IVisitor<TR> type parameters
For some use cases of the IVisitor interfaces mentioned above, we need to be able to provide a type parameter (typically "object"). Instead of hard-wiring these interfaces to return "object", we have made them be a couple of type-parameterized interfaces. However, for other use cases the return type does not make sense.
Since "void" is not a type in .NET, we must use something else than void to describe "no return value". The VoidObject is an answer to this question. Given that it is abstract, it can never be instantiated. A visitor using this type as type parameter is expected to return "VoidObject.Void" from all its methods.
Interfaces
Expr.IVisitor<TR>
IEnvironment
IPerlangFunction
Interface for Perlang function implementations.
ITokenAware
Interface for expressions and statements which provide a Token. This is used to augment error handling, for a better end-user experience.