Libraries.Language.Compile.Parsing.QuorumParser Documentation

This class defines the parser for the Quorum programming language. Individual actions make their own assumptions about where in the token stream they are. For example, while the Start action assumes a full Quorum program, Expression assumes we are parsing only an expression. This provides us considerable flexibility in how we manage and parse programs in Quorum.

Inherits from: Libraries.Language.Object

Actions Documentation

ActionCall()

Processes an action call Expression

Return

Libraries.Language.Compile.Context.ActionCallContext:

ActionDeclaration()

Process just the declaration of an action, including its block if it has one.

Return

Libraries.Language.Compile.Context.ParseContext:

ActionExpressionList()

Processes an expression list inside of another Expression

Return

Libraries.Language.Compile.Context.ActionExpressionListContext:

ActionOrParentActionCall()

Processes an action call that is either a normal or a parent one

Return

Libraries.Language.Compile.Context.ParseContext:

ActionShared()

This processes the header of an action declaration.

Return

Libraries.Language.Compile.Context.ActionContext:

Addition()

Processes a +/- Expression

Return

Libraries.Language.Compile.Context.ParseContext:

AlertStatement()

This processes an alert statement.

Return

Libraries.Language.Compile.Context.AlertContext:

AlwaysStatement()

This processes a always statement.

Return

Libraries.Language.Compile.Context.AlwaysStatementContext:

And()

Processes and And Expression

Return

Libraries.Language.Compile.Context.ParseContext:

AssignmentDeclaration()

Process one statement assumed to be an assignment statement.

Return

Libraries.Language.Compile.Context.AssignmentDeclaractionContext:

AssignmentStatement()

This processes a generic assignment statement of any legal kind.

Return

Libraries.Language.Compile.Context.ParseContext:

AssignmentStatementInFieldBlock()

Boolean()

Processes a boolean Expression

Return

Libraries.Language.Compile.Context.BooleanContext:

Cast()

Processes a cast Expression

Return

Libraries.Language.Compile.Context.CastContext:

CheckStatement()

This processes a check statement.

Return

Libraries.Language.Compile.Context.CheckContext:

Class()

This action parses a class definition.

Return

Libraries.Language.Compile.Context.ParseContext:

ClassStatement()

Process one statement issued inside of a class, either an action declaration or an assignment statement.

Return

Libraries.Language.Compile.Context.ClassStatementsContext:

ClassType()

Processes and class type value, which is just a qualified name

Return

Libraries.Language.Compile.Context.ClassTypeContext:

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

DetectStatement()

This processes a detect statement.

Return

Libraries.Language.Compile.Context.DetectStatementContext:

Equals()

Processes and = or not= Expression

Return

Libraries.Language.Compile.Context.ParseContext:

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

Expression()

FormalParameter()

This processes a single parameter.

Return

Libraries.Language.Compile.Context.FormalParameterContext:

FullClass()

Parse a class definition that is explicit, meaning that the user typed class, a name, etc.

Return

Libraries.Language.Compile.Context.FullClassDeclarationContext:

GenericDeclaration()

GenericStatement()

Process a single generic statement.

Return

Libraries.Language.Compile.Context.GenericContext:

GetCompilerErrorManager()

Returns the compiler error manager used in this parser.

Return

Libraries.Language.Compile.CompilerErrorManager:

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

Greater()

Processes a > Expression

Return

Libraries.Language.Compile.Context.ParseContext:

HasNext()

This action returns that the stream is valid if there are no errors in the error manager and if the current token is a valid token. An error manager must be defined, otherwise the parser cannot track its issues and therefore always throws an error.

Return

boolean:

IfStatement()

This processes a if statement.

Return

Libraries.Language.Compile.Context.IfContext:

IneritanceDeclaration()

InheritanceStatement()

Process an individual statement related to inheritance.

Return

Libraries.Language.Compile.Context.InheritStatementContext:

Inherits()

Processes an is expression

Return

Libraries.Language.Compile.Context.ParseContext:

Input()

Processes an input Expression

Return

Libraries.Language.Compile.Context.InputContext:

Integer()

Processes an integer Expression

Return

Libraries.Language.Compile.Context.IntegerContext:

IsOutputMisspelling(Libraries.Language.Compile.Parsing.Token token)

This action determines if the token is likely to be a misspelling of the word output.

Parameters

Return

boolean:

IsSayMisspelling(Libraries.Language.Compile.Parsing.Token token)

This action determines if the token is likely to be a misspelling of the word say.

Parameters

Return

boolean:

IsValid()

This action returns that the stream is valid if there are no errors in the error manager and if the current token is a valid token. An error manager must be defined, otherwise the parser cannot track its issues and therefore always throws an error.

Return

boolean:

Literal()

Processes an literal Expression

Return

Libraries.Language.Compile.Context.ParseContext:

Me()

Processes the me variable Expression

Return

Libraries.Language.Compile.Context.MeContext:

Multiplication()

Processes a * or / Expression

Return

Libraries.Language.Compile.Context.ParseContext:

NoClass()

This action processes an implicit class statement, where the user did not write out a class and classname.

Return

Libraries.Language.Compile.Context.NoClassDeclarationContext:

NoTypeAssignment()

Process an assignment statement if no type is provided.

Return

Libraries.Language.Compile.Context.NoTypeAssignmentContext:

NormalAssignment()

Processes a full assignment statement. modifier = access_modifier? CONSTANT? type = assignment_declaration name = ID (EQUALITY rhs = expression)? #NormalAssignment

Return

Libraries.Language.Compile.Context.NormalAssignmentContext:

Number()

Processes a number Expression

Return

Libraries.Language.Compile.Context.NumberContext:

ObjectAssignment()

Process an assignment statement if no type is provided. object=ID (COLON PARENT COLON parent=qualified_name)? COLON name = ID EQUALITY rhs = expression #ObjectAssignment

Return

Libraries.Language.Compile.Context.ObjectAssignmentContext:

Or()

OutputStatement()

This processes a output statement.

Return

Libraries.Language.Compile.Context.OutputContext:

Package()

Process one package statement.

Return

Libraries.Language.Compile.Context.PackageContext:

ParentAssignment()

Process an assignment statement if we are assigning to a parent.

Return

Libraries.Language.Compile.Context.ParentAssignmentContext:

ParentVariableActionCall()

Processes an action call from a parent Expression

Return

Libraries.Language.Compile.Context.ParentVariableFunctionCallContext:

ParentVariableSoloActionCall()

Parenthesis()

Processes a paren () Expression

Return

Libraries.Language.Compile.Context.ParenthesisContext:

QualifiedName()

RepeatStatement()

This processes just a repeat statement.

Return

Libraries.Language.Compile.Context.LoopContext:

ReturnStatement()

This processes only a return statement.

Return

Libraries.Language.Compile.Context.ReturnContext:

SayStatement()

This processes a say statement.

Return

Libraries.Language.Compile.Context.SayContext:

SetCompilerErrorManager(Libraries.Language.Compile.CompilerErrorManager compilerErrorManager)

Sets the compiler error manager used in this parser.

Parameters

SetLexer(Libraries.Language.Compile.Parsing.QuorumLexer lexer)

Start()

This action obtains a parse from a token stream assuming a complete Quorum program. A valid lexer must have been sent to the parser before calling this action.

Return

Libraries.Language.Compile.Context.StartContext:

Statement()

Process a single generic statement.

Return

Libraries.Language.Compile.Context.StatementContext:

Text()

Processes a text Expression

Return

Libraries.Language.Compile.Context.TextContext:

UnaryOperator()

Processes a unary operator Expression

Return

Libraries.Language.Compile.Context.ParseContext:

Undefined()

Processes a text Expression

Return

Libraries.Language.Compile.Context.UndefinedContext:

Use()

Process one use statement

Return

Libraries.Language.Compile.Context.UseContext:

Uses()

Processes all use statements and places them in an array.

Return

Libraries.Containers.Array:

VariableFunctionCall()

Processes an action call, from a variable, Expression

Return

Libraries.Language.Compile.Context.VariableFunctionCallContext:

VariableSoloActionCall()

Statement of an action call on a line.

Return

Libraries.Language.Compile.Context.VariableFunctionCallContext: