From 7f334796e8d0619dc744b1345a7b7b73a27220f9 Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Sat, 9 Aug 2025 09:45:22 +1000 Subject: added method calling and for loops --- Compiler/gen/CGrammarBaseVisitor.cs | 113 ++++++++++++++++++++++++++++++++---- 1 file changed, 101 insertions(+), 12 deletions(-) (limited to 'Compiler/gen/CGrammarBaseVisitor.cs') diff --git a/Compiler/gen/CGrammarBaseVisitor.cs b/Compiler/gen/CGrammarBaseVisitor.cs index 9964929..0893e73 100644 --- a/Compiler/gen/CGrammarBaseVisitor.cs +++ b/Compiler/gen/CGrammarBaseVisitor.cs @@ -45,7 +45,8 @@ public partial class CGrammarBaseVisitor : AbstractParseTreeVisitorThe visitor result. public virtual Result VisitProgram([NotNull] CGrammarParser.ProgramContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by . + /// Visit a parse tree produced by the functionPrototype + /// labeled alternative in . /// /// The default implementation returns the result of calling /// on . @@ -53,7 +54,18 @@ public partial class CGrammarBaseVisitor : AbstractParseTreeVisitor /// The parse tree. /// The visitor result. - public virtual Result VisitFunction([NotNull] CGrammarParser.FunctionContext context) { return VisitChildren(context); } + public virtual Result VisitFunctionPrototype([NotNull] CGrammarParser.FunctionPrototypeContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by the functionDefinition + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitFunctionDefinition([NotNull] CGrammarParser.FunctionDefinitionContext context) { return VisitChildren(context); } /// /// Visit a parse tree produced by . /// @@ -97,6 +109,72 @@ public partial class CGrammarBaseVisitor : AbstractParseTreeVisitorThe visitor result. public virtual Result VisitIfStatement([NotNull] CGrammarParser.IfStatementContext context) { return VisitChildren(context); } /// + /// Visit a parse tree produced by the forExprStatement + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitForExprStatement([NotNull] CGrammarParser.ForExprStatementContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by the forDeclStatement + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitForDeclStatement([NotNull] CGrammarParser.ForDeclStatementContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by the whileStatement + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitWhileStatement([NotNull] CGrammarParser.WhileStatementContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by the doWhileStatement + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitDoWhileStatement([NotNull] CGrammarParser.DoWhileStatementContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by the breakStatement + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitBreakStatement([NotNull] CGrammarParser.BreakStatementContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by the continueStatement + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitContinueStatement([NotNull] CGrammarParser.ContinueStatementContext context) { return VisitChildren(context); } + /// /// Visit a parse tree produced by the expressionStatement /// labeled alternative in . /// @@ -119,6 +197,17 @@ public partial class CGrammarBaseVisitor : AbstractParseTreeVisitorThe visitor result. public virtual Result VisitBlockStatement([NotNull] CGrammarParser.BlockStatementContext context) { return VisitChildren(context); } /// + /// Visit a parse tree produced by the nullStatement + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitNullStatement([NotNull] CGrammarParser.NullStatementContext context) { return VisitChildren(context); } + /// /// Visit a parse tree produced by the variableDeclaration /// labeled alternative in . /// @@ -449,7 +538,7 @@ public partial class CGrammarBaseVisitor : AbstractParseTreeVisitorThe visitor result. public virtual Result VisitLogicalOrExpression([NotNull] CGrammarParser.LogicalOrExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the commaExpression + /// Visit a parse tree produced by the incrementPrefixExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -458,9 +547,9 @@ public partial class CGrammarBaseVisitor : AbstractParseTreeVisitor /// The parse tree. /// The visitor result. - public virtual Result VisitCommaExpression([NotNull] CGrammarParser.CommaExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitIncrementPrefixExpression([NotNull] CGrammarParser.IncrementPrefixExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the incrementPrefixExpression + /// Visit a parse tree produced by the greaterThanOrEqualExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -469,9 +558,9 @@ public partial class CGrammarBaseVisitor : AbstractParseTreeVisitor /// The parse tree. /// The visitor result. - public virtual Result VisitIncrementPrefixExpression([NotNull] CGrammarParser.IncrementPrefixExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitGreaterThanOrEqualExpression([NotNull] CGrammarParser.GreaterThanOrEqualExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the greaterThanOrEqualExpression + /// Visit a parse tree produced by the divideExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -480,9 +569,9 @@ public partial class CGrammarBaseVisitor : AbstractParseTreeVisitor /// The parse tree. /// The visitor result. - public virtual Result VisitGreaterThanOrEqualExpression([NotNull] CGrammarParser.GreaterThanOrEqualExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitDivideExpression([NotNull] CGrammarParser.DivideExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the divideExpression + /// Visit a parse tree produced by the bitwiseOrExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -491,9 +580,9 @@ public partial class CGrammarBaseVisitor : AbstractParseTreeVisitor /// The parse tree. /// The visitor result. - public virtual Result VisitDivideExpression([NotNull] CGrammarParser.DivideExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitBitwiseOrExpression([NotNull] CGrammarParser.BitwiseOrExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the bitwiseOrExpression + /// Visit a parse tree produced by the callExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -502,7 +591,7 @@ public partial class CGrammarBaseVisitor : AbstractParseTreeVisitor /// The parse tree. /// The visitor result. - public virtual Result VisitBitwiseOrExpression([NotNull] CGrammarParser.BitwiseOrExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitCallExpression([NotNull] CGrammarParser.CallExpressionContext context) { return VisitChildren(context); } /// /// Visit a parse tree produced by the addExpression /// labeled alternative in . -- cgit v1.3.1