VAlgoLangParserVisitor

class VAlgoLangParserVisitor : VAlgoLangParserBaseVisitor<ASTNode>

VAlgoLang parser visitor

This class implements the VAlgoLangParserBaseVisitor abstract class returning an abstract syntax tree(AST). Here it traverses the concrete syntax tree (parse tree) to perform semantic analysis, construct the line to statement node map (lineNumberNodeMap) and the AST.

Constructors

VAlgoLangParserVisitor
Link copied to clipboard
fun VAlgoLangParserVisitor()
Create empty V algo lang parser visitor

Functions

aggregateResult
Link copied to clipboard
open fun aggregateResult(aggregate: ASTNode, nextResult: ASTNode): ASTNode
defaultResult
Link copied to clipboard
open fun defaultResult(): ASTNode
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
shouldVisitNextChild
Link copied to clipboard
open fun shouldVisitNextChild(node: RuleNode, currentResult: ASTNode): Boolean
toString
Link copied to clipboard
open fun toString(): String
visit
Link copied to clipboard
open override fun visit(tree: ParseTree): ASTNode
visitAnnotationStatement
Link copied to clipboard
open override fun visitAnnotationStatement(ctx: VAlgoLangParser.AnnotationStatementContext): ASTNode
visitArgumentList
Link copied to clipboard
open override fun visitArgumentList(ctx: VAlgoLangParser.ArgumentListContext?): ArgumentNode
visitArray_elem
Link copied to clipboard
open override fun visitArray_elem(ctx: VAlgoLangParser.Array_elemContext): ArrayElemNode
visitArrayElemAssignment
Link copied to clipboard
open override fun visitArrayElemAssignment(ctx: VAlgoLangParser.ArrayElemAssignmentContext): ASTNode
visitArrayElemExpr
Link copied to clipboard
open override fun visitArrayElemExpr(ctx: VAlgoLangParser.ArrayElemExprContext): ASTNode
visitArrayType
Link copied to clipboard
open override fun visitArrayType(ctx: VAlgoLangParser.ArrayTypeContext): ArrayType
visitAssignmentStatement
Link copied to clipboard
open override fun visitAssignmentStatement(ctx: VAlgoLangParser.AssignmentStatementContext): AssignmentNode
visitBinaryExpression
Link copied to clipboard
open override fun visitBinaryExpression(ctx: VAlgoLangParser.BinaryExpressionContext): BinaryExpression
visitBool
Link copied to clipboard
open override fun visitBool(ctx: VAlgoLangParser.BoolContext): ASTNode
visitBooleanLiteral
Link copied to clipboard
open override fun visitBooleanLiteral(ctx: VAlgoLangParser.BooleanLiteralContext): ASTNode
visitBoolType
Link copied to clipboard
open override fun visitBoolType(ctx: VAlgoLangParser.BoolTypeContext): ASTNode
visitBracketedExpression
Link copied to clipboard
open override fun visitBracketedExpression(ctx: VAlgoLangParser.BracketedExpressionContext): ExpressionNode
visitBreakStatement
Link copied to clipboard
open override fun visitBreakStatement(ctx: VAlgoLangParser.BreakStatementContext): BreakNode
visitCastExpression
Link copied to clipboard
open override fun visitCastExpression(ctx: VAlgoLangParser.CastExpressionContext): ASTNode
visitCharacterLiteral
Link copied to clipboard
open override fun visitCharacterLiteral(ctx: VAlgoLangParser.CharacterLiteralContext): ASTNode
visitCharType
Link copied to clipboard
open override fun visitCharType(ctx: VAlgoLangParser.CharTypeContext?): ASTNode
visitChildren
Link copied to clipboard
open override fun visitChildren(node: RuleNode): ASTNode
visitCodeTrackingAnnotation
Link copied to clipboard
Annotations
visitConsecutiveStatement
Link copied to clipboard
open override fun visitConsecutiveStatement(ctx: VAlgoLangParser.ConsecutiveStatementContext): ASTNode
visitContinueStatement
Link copied to clipboard
open override fun visitContinueStatement(ctx: VAlgoLangParser.ContinueStatementContext): ContinueNode
visitDataStructureConstructor
Link copied to clipboard
visitDataStructureType
Link copied to clipboard
open override fun visitDataStructureType(ctx: VAlgoLangParser.DataStructureTypeContext): DataStructureType
visitDeclarationStatement
Link copied to clipboard
visitElseIf
Link copied to clipboard
open override fun visitElseIf(ctx: VAlgoLangParser.ElseIfContext): ASTNode
visitErrorNode
Link copied to clipboard
open override fun visitErrorNode(node: ErrorNode): ASTNode
visitForStatement
Link copied to clipboard
open override fun visitForStatement(ctx: VAlgoLangParser.ForStatementContext): ASTNode
visitFunction
Link copied to clipboard
open override fun visitFunction(ctx: VAlgoLangParser.FunctionContext): FunctionNode
visitFunctionCall
Link copied to clipboard
open override fun visitFunctionCall(ctx: VAlgoLangParser.FunctionCallContext): FunctionCallNode
visitIdentifier
Link copied to clipboard
open override fun visitIdentifier(ctx: VAlgoLangParser.IdentifierContext): IdentifierNode
visitIdentifierAssignment
Link copied to clipboard
open override fun visitIdentifierAssignment(ctx: VAlgoLangParser.IdentifierAssignmentContext): ASTNode
visitIfStatement
Link copied to clipboard
open override fun visitIfStatement(ctx: VAlgoLangParser.IfStatementContext): ASTNode
visitInitialiser_list
Link copied to clipboard
Data structure Initialisers
visitListType
Link copied to clipboard
open override fun visitListType(ctx: VAlgoLangParser.ListTypeContext): ASTNode
visitLoopStatement
Link copied to clipboard
open override fun visitLoopStatement(ctx: VAlgoLangParser.LoopStatementContext): LoopStatementNode
visitMethodCall
Link copied to clipboard
open override fun visitMethodCall(ctx: VAlgoLangParser.MethodCallContext): ExpressionNode
visitMethodCallExpression
Link copied to clipboard
open override fun visitMethodCallExpression(ctx: VAlgoLangParser.MethodCallExpressionContext): ASTNode
Expressions
visitMethodCallStatement
Link copied to clipboard
open override fun visitMethodCallStatement(ctx: VAlgoLangParser.MethodCallStatementContext): ASTNode
visitNode_elem
Link copied to clipboard
open override fun visitNode_elem(ctx: VAlgoLangParser.Node_elemContext): ASTNode
visitNode_elem_access
Link copied to clipboard
open override fun visitNode_elem_access(ctx: VAlgoLangParser.Node_elem_accessContext): ASTNode
visitNode_type
Link copied to clipboard
open override fun visitNode_type(ctx: VAlgoLangParser.Node_typeContext): BinaryTreeNodeType
visitNodeElemAssignment
Link copied to clipboard
open override fun visitNodeElemAssignment(ctx: VAlgoLangParser.NodeElemAssignmentContext): ASTNode
visitNodeElemExpr
Link copied to clipboard
open override fun visitNodeElemExpr(ctx: VAlgoLangParser.NodeElemExprContext): ASTNode
visitNodeType
Link copied to clipboard
open override fun visitNodeType(ctx: VAlgoLangParser.NodeTypeContext): BinaryTreeNodeType
visitNullLiteral
Link copied to clipboard
open override fun visitNullLiteral(ctx: VAlgoLangParser.NullLiteralContext): ASTNode
visitNumberLiteral
Link copied to clipboard
open override fun visitNumberLiteral(ctx: VAlgoLangParser.NumberLiteralContext): NumberNode
Literals
visitNumberType
Link copied to clipboard
open override fun visitNumberType(ctx: VAlgoLangParser.NumberTypeContext): NumberType
visitParameter
Link copied to clipboard
open override fun visitParameter(ctx: VAlgoLangParser.ParameterContext): ParameterNode
visitParameterList
Link copied to clipboard
open override fun visitParameterList(ctx: VAlgoLangParser.ParameterListContext?): ParameterListNode
visitPrimitiveType
Link copied to clipboard
open override fun visitPrimitiveType(ctx: VAlgoLangParser.PrimitiveTypeContext): PrimitiveType
Types
visitProgram
Link copied to clipboard
open override fun visitProgram(ctx: VAlgoLangParser.ProgramContext): ProgramNode
visitRangeHeader
Link copied to clipboard
open override fun visitRangeHeader(ctx: VAlgoLangParser.RangeHeaderContext): ASTNode
visitReturnStatement
Link copied to clipboard
open override fun visitReturnStatement(ctx: VAlgoLangParser.ReturnStatementContext): ReturnNode
visitSleepStatement
Link copied to clipboard
open override fun visitSleepStatement(ctx: VAlgoLangParser.SleepStatementContext): SleepNode
Statements
visitStackType
Link copied to clipboard
open override fun visitStackType(ctx: VAlgoLangParser.StackTypeContext): StackType
visitStringLiteral
Link copied to clipboard
open override fun visitStringLiteral(ctx: VAlgoLangParser.StringLiteralContext): ASTNode
visitStringType
Link copied to clipboard
open override fun visitStringType(ctx: VAlgoLangParser.StringTypeContext?): ASTNode
visitSubtitleAnnotation
Link copied to clipboard
visitTerminal
Link copied to clipboard
open override fun visitTerminal(node: TerminalNode): ASTNode
visitToCharacter
Link copied to clipboard
open override fun visitToCharacter(ctx: VAlgoLangParser.ToCharacterContext): ASTNode
visitToNumber
Link copied to clipboard
open override fun visitToNumber(ctx: VAlgoLangParser.ToNumberContext): ASTNode
visitTreeType
Link copied to clipboard
open override fun visitTreeType(ctx: VAlgoLangParser.TreeTypeContext): BinaryTreeType
visitUnaryOperator
Link copied to clipboard
open override fun visitUnaryOperator(ctx: VAlgoLangParser.UnaryOperatorContext): UnaryExpression
visitWhileStatement
Link copied to clipboard
open override fun visitWhileStatement(ctx: VAlgoLangParser.WhileStatementContext): ASTNode

Properties

lineNumberNodeMap
Link copied to clipboard
val lineNumberNodeMap: MutableMap<Int, StatementNode>
symbolTable
Link copied to clipboard
val symbolTable: SymbolTableVisitor