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

Summary

Actions Summary Table

ActionsDescription
ActionCall()Processes an action call Expression
ActionDeclaration()Process just the declaration of an action, including its block if it has one.
ActionExpressionList()Processes an expression list inside of another Expression
ActionOrParentActionCall()Processes an action call that is either a normal or a parent one
ActionShared()This processes the header of an action declaration.
Addition()Processes a +/- Expression
AlertStatement()This processes an alert statement.
AlwaysStatement()This processes a always statement.
And()Processes and And Expression
AssignmentDeclaration()Process one statement assumed to be an assignment statement.
AssignmentStatement()This processes a generic assignment statement of any legal kind.
AssignmentStatementInFieldBlock()this is an err
Block()Process a block.
Boolean()Processes a boolean Expression
Cast()Processes a cast Expression
CheckStatement()This processes a check statement.
Class()This action parses a class definition.
ClassStatement()Process one statement issued inside of a class, either an action declaration or an assignment statement.
ClassType()Processes and class type value, which is just a qualified name
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
DetectStatement()This processes a detect statement.
Equals()Processes and = or not= Expression
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
Expression()Process an expression.
FormalParameter()This processes a single parameter.
FullClass()Parse a class definition that is explicit, meaning that the user typed class, a name, etc.
GenericDeclaration()This processes generics.
GenericStatement()Process a single generic statement.
GetCompilerErrorManager()Returns the compiler error manager used in this parser.
GetHashCode()This action gets the hash code for an object.
GetLexer()
Greater()Processes a > Expression
IfStatement()This processes a if statement.
IneritanceDeclaration()Process inheritance
InheritanceStatement()Process an individual statement related to inheritance.
Inherits()Processes an is expression
Input()Processes an input Expression
Integer()Processes an integer Expression
IsOutputMisspelling(Libraries.Language.Compile.Parsing.Token token)This action determines if the token is likely to be a misspelling of the word output.
IsSayMisspelling(Libraries.Language.Compile.Parsing.Token token)This action determines if the token is likely to be a misspelling of the word say.
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.
Literal()Processes an literal Expression
Me()Processes the me variable Expression
Multiplication()Processes a * or / Expression
NoClass()This action processes an implicit class statement, where the user did not write out a class and classname.
NoTypeAssignment()Process an assignment statement if no type is provided.
NormalAssignment()Processes a full assignment statement.
Number()Processes a number Expression
ObjectAssignment()Process an assignment statement if no type is provided.
Or()Process an expression.
OutputStatement()This processes a output statement.
Package()Process one package statement.
ParentAssignment()Process an assignment statement if we are assigning to a parent.
ParentVariableActionCall()Processes an action call from a parent Expression
ParentVariableSoloActionCall()An action call involving a parent.
Parenthesis()Processes a paren () Expression
QualifiedName()Process a qualified name.
RepeatStatement()This processes just a repeat statement.
ReturnStatement()This processes only a return statement.
SayStatement()This processes a say statement.
SetCompilerErrorManager(Libraries.Language.Compile.CompilerErrorManager compilerErrorManager)Sets the compiler error manager used in this parser.
SetLexer(Libraries.Language.Compile.Parsing.QuorumLexer lexer)
Start()This action obtains a parse from a token stream assuming a complete Quorum program.
Statement()Process a single generic statement.
Text()Processes a text Expression
UnaryOperator()Processes a unary operator Expression
Undefined()Processes a text Expression
Use()Process one use statement
Uses()Processes all use statements and places them in an array.
VariableFunctionCall()Processes an action call, from a variable, Expression
VariableSoloActionCall()Statement of an action call on a line.

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()

this is an err

Return

Libraries.Language.Compile.Context.ParseContext:

Block()

Process a block.

Return

Libraries.Language.Compile.Context.BlockContext:

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.

Example Code

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

Parameters

Return

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

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.

Example Code

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

Parameters

Return

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

Expression()

Process an expression.

Return

Libraries.Language.Compile.Context.ParseContext:

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()

This processes generics.

Return

Libraries.Language.Compile.Context.GenericDeclarationContext:

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.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetLexer()

Return

Libraries.Language.Compile.Parsing.QuorumLexer

Greater()

Processes a > Expression

Return

Libraries.Language.Compile.Context.ParseContext:

IfStatement()

This processes a if statement.

Return

Libraries.Language.Compile.Context.IfContext:

IneritanceDeclaration()

Process inheritance

Return

Libraries.Language.Compile.Context.InheritStatementsContext:

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()

Process an expression.

Return

Libraries.Language.Compile.Context.ParseContext:

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()

An action call involving a parent.

Return

Libraries.Language.Compile.Context.ParentVariableFunctionCallContext:

Parenthesis()

Processes a paren () Expression

Return

Libraries.Language.Compile.Context.ParenthesisContext:

QualifiedName()

Process a qualified name.

Return

Libraries.Language.Compile.Context.QualifiedNameContext:

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)

Parameters

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: