diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-09 12:51:08 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-09 12:51:08 +1000 |
| commit | 78d73c6e3a6e96b750bc4100f754484890ea650b (patch) | |
| tree | 5c6f8b891513534f4fe722202fcbd3f075536c6e | |
| parent | 7f334796e8d0619dc744b1345a7b7b73a27220f9 (diff) | |
added lazy function definition
| -rw-r--r-- | Compiler/CCompilerVisitor.cs | 68 | ||||
| -rw-r--r-- | Compiler/CGrammar.g4 | 4 | ||||
| -rw-r--r-- | Compiler/gen/CGrammar.interp | 6 | ||||
| -rw-r--r-- | Compiler/gen/CGrammar.tokens | 34 | ||||
| -rw-r--r-- | Compiler/gen/CGrammarBaseVisitor.cs | 22 | ||||
| -rw-r--r-- | Compiler/gen/CGrammarLexer.cs | 40 | ||||
| -rw-r--r-- | Compiler/gen/CGrammarLexer.interp | 6 | ||||
| -rw-r--r-- | Compiler/gen/CGrammarLexer.tokens | 34 | ||||
| -rw-r--r-- | Compiler/gen/CGrammarParser.cs | 581 | ||||
| -rw-r--r-- | Compiler/gen/CGrammarVisitor.cs | 14 | ||||
| -rw-r--r-- | Emulator/Program.cs | 1 | ||||
| -rw-r--r-- | ROMs/hello_c.asm | 35 | ||||
| -rw-r--r-- | ROMs/hello_c.c | 10 | ||||
| -rw-r--r-- | ROMs/hello_c.q1 | bin | 72 -> 55 bytes |
14 files changed, 488 insertions, 367 deletions
diff --git a/Compiler/CCompilerVisitor.cs b/Compiler/CCompilerVisitor.cs index abe831d..cbfc758 100644 --- a/Compiler/CCompilerVisitor.cs +++ b/Compiler/CCompilerVisitor.cs @@ -6,13 +6,17 @@ using Emulator; public class CCompilerVisitor : CGrammarBaseVisitor<string?> { - private int _branchCount = 1; - private List<string> _instructions = new(); - private Stack<Dictionary<string, VariableReference>> _variableStack = new(); - private List<FunctionReference> _methods = new(); + private int _branchCount = 1; + private List<string> _instructions = new(); + private Stack<Dictionary<string, VariableReference>> _variableStack = new(); + private List<FunctionReference> _methods = new(); private static int _memLowest = Q1Layout.FreeMemoryStart; private static int _memPointer = CCompilerVisitor._memLowest; + private List<(CGrammarParser.FunctionDefinitionContext context, + FunctionReference function, FunctionOverload overload, + List<string> paramNames, List<string> paramTypes)> _functionBodies = new(); + private const int ColumnWidth = 30; public readonly CommentCompilationMode CommentMode; @@ -92,6 +96,12 @@ public class CCompilerVisitor : CGrammarBaseVisitor<string?> { Instruction("jmp _main"); this.Visit(program); + + foreach ((CGrammarParser.FunctionDefinitionContext context, + FunctionReference function, FunctionOverload overload, + List<string> paramNames, List<string> paramTypes) in this._functionBodies) + this.VisitFunctionBody(context, function, overload, paramNames, paramTypes); + return this._instructions; } @@ -100,13 +110,13 @@ public class CCompilerVisitor : CGrammarBaseVisitor<string?> FunctionReference? function = this._methods.FirstOrDefault(x => x.Name == name); if (function != null) return function; - + function = new FunctionReference(name, type); this._methods.Add(function); return function; } - + private FunctionReference GetFunctionReference(string name) { FunctionReference? function = this._methods.FirstOrDefault(x => x.Name == name); @@ -126,7 +136,7 @@ public class CCompilerVisitor : CGrammarBaseVisitor<string?> FunctionReference function = this.CreateOrGetFunctionReference(functionName, type); FunctionOverload overload = function.CreateOverloadWithoutBody(parameterNames, parameterTypes); - + function.Overloads.Add(overload); return null; @@ -135,18 +145,24 @@ public class CCompilerVisitor : CGrammarBaseVisitor<string?> { string functionName = context.name.Text; string type = "int"; - + List<string> paramTypes = context._types.Select(x => x.Text).ToList(); List<string> paramNames = context._params.Select(x => x.Text).ToList(); FunctionReference function = this.CreateOrGetFunctionReference(functionName, type); FunctionOverload overload = function.CreateOverloadWithBody(paramNames, paramTypes); + this._functionBodies.Add((context, function, overload, paramNames, paramTypes)); + + return null; + } + private void VisitFunctionBody(CGrammarParser.FunctionDefinitionContext context, FunctionReference function, FunctionOverload overload, List<string> paramNames, List<string> paramTypes) + { this.Branch(function.GetBranchName(overload), function.GetBranchFriendlyName(overload)); if (paramNames.Count > 0) this.Instruction("pop V0", "preserve function return address"); - + Dictionary<string, VariableReference> scope = this.EnterScope(); foreach ((string paramName, string paramType) in paramNames.Zip(paramTypes)) { @@ -155,18 +171,16 @@ public class CCompilerVisitor : CGrammarBaseVisitor<string?> scope[paramName] = new(addr, paramSize); this.Instruction($"pop [${addr:X4}]", $"param {paramType} {paramName}"); } - + if (paramNames.Count > 0) this.Instruction("push V0", "restore function return address"); - + this.VisitChildren(context); this.ExitScope(); - + this.Instruction("mov 0, V0", "fallback return 0"); this.Instruction("ret"); this.Blank(); - - return null; } public override string? VisitCallExpression(CGrammarParser.CallExpressionContext context) @@ -178,7 +192,7 @@ public class CCompilerVisitor : CGrammarBaseVisitor<string?> // We reverse arugments so when we perform pop, its in the right order CGrammarParser.ExpressionContext[] argumentsReversed = context._params.Reverse().ToArray(); - + for (int i = 0; i < argumentsReversed.Length; i++) { CGrammarParser.ExpressionContext argument = argumentsReversed[i]; @@ -187,7 +201,7 @@ public class CCompilerVisitor : CGrammarBaseVisitor<string?> this.Instruction($"push {result}", $"arg {overload.ParameterTypes[i]} {overload.ParameterNames[i]}"); } - + this.Instruction($"call {function.GetBranchName(overload)}", function.GetBranchFriendlyName(overload)); return "V0"; @@ -815,6 +829,28 @@ public class CCompilerVisitor : CGrammarBaseVisitor<string?> return null; } + public override string? VisitAddressOfExpression(CGrammarParser.AddressOfExpressionContext context) + { + string target = this.Visit(context.target()) + ?? throw new CompilerException("Address of target was not a targetable expression"); + + if (target.StartsWith("@")) + return target[1..]; + + if (target.StartsWith("[") && target.EndsWith("]")) + return target[1..^1]; + + throw new CompilerException($"Could not get address of target '{target}'"); + } + public override string? VisitDereferenceExpression(CGrammarParser.DereferenceExpressionContext context) + { + string value = this.Visit(context.expression()) + ?? throw new CompilerException("Dereference pointer was not an expression"); + + this.Instruction($"mov {value}, V0", "move pointer into register for dereference"); + return "[V0]"; + } + public override string? VisitErrorNode(IErrorNode node) { if (node.Symbol.Type == CGrammarParser.COMMENT) diff --git a/Compiler/CGrammar.g4 b/Compiler/CGrammar.g4 index b0f145f..1b47978 100644 --- a/Compiler/CGrammar.g4 +++ b/Compiler/CGrammar.g4 @@ -44,7 +44,7 @@ statement declaration - : 'int' name=ID ('=' value=expression)? ';' #variableDeclaration + : 'int' ptr='*' name=ID ('=' value=expression)? ';' #variableDeclaration ; expression @@ -52,6 +52,8 @@ expression // | left=expression ',' right=expression #commaExpression | constant #constantExpression | target '=' expression #assignmentExpression + | '*' expression #dereferenceExpression + | '&' target #addressOfExpression | ID #variableExpression | ID '(' ( params+=expression (',' params+=expression )* )? ')' #callExpression diff --git a/Compiler/gen/CGrammar.interp b/Compiler/gen/CGrammar.interp index 6c55ec3..7018946 100644 --- a/Compiler/gen/CGrammar.interp +++ b/Compiler/gen/CGrammar.interp @@ -15,12 +15,13 @@ null 'do' 'break' 'continue' +'*' '=' +'&' '!' '~' '++' '--' -'*' '/' '%' '+' @@ -31,7 +32,6 @@ null '>=' '==' '!=' -'&' '|' '^' '<<' @@ -125,4 +125,4 @@ target atn: -[4, 1, 54, 298, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 1, 0, 4, 0, 20, 8, 0, 11, 0, 12, 0, 21, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 3, 1, 39, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 51, 8, 1, 10, 1, 12, 1, 54, 9, 1, 3, 1, 56, 8, 1, 1, 1, 1, 1, 3, 1, 60, 8, 1, 1, 2, 1, 2, 5, 2, 64, 8, 2, 10, 2, 12, 2, 67, 9, 2, 1, 2, 1, 2, 1, 3, 1, 3, 3, 3, 73, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 86, 8, 4, 1, 4, 1, 4, 1, 4, 3, 4, 91, 8, 4, 1, 4, 1, 4, 3, 4, 95, 8, 4, 1, 4, 1, 4, 3, 4, 99, 8, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 107, 8, 4, 1, 4, 1, 4, 3, 4, 111, 8, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 139, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 145, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 165, 8, 6, 10, 6, 12, 6, 168, 9, 6, 3, 6, 170, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 227, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 289, 8, 6, 10, 6, 12, 6, 292, 9, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 0, 1, 12, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 0, 0, 354, 0, 19, 1, 0, 0, 0, 2, 59, 1, 0, 0, 0, 4, 61, 1, 0, 0, 0, 6, 72, 1, 0, 0, 0, 8, 138, 1, 0, 0, 0, 10, 140, 1, 0, 0, 0, 12, 226, 1, 0, 0, 0, 14, 293, 1, 0, 0, 0, 16, 295, 1, 0, 0, 0, 18, 20, 3, 2, 1, 0, 19, 18, 1, 0, 0, 0, 20, 21, 1, 0, 0, 0, 21, 19, 1, 0, 0, 0, 21, 22, 1, 0, 0, 0, 22, 23, 1, 0, 0, 0, 23, 24, 5, 0, 0, 1, 24, 1, 1, 0, 0, 0, 25, 26, 5, 1, 0, 0, 26, 27, 5, 51, 0, 0, 27, 38, 5, 2, 0, 0, 28, 29, 5, 1, 0, 0, 29, 35, 5, 51, 0, 0, 30, 31, 5, 3, 0, 0, 31, 32, 5, 1, 0, 0, 32, 34, 5, 51, 0, 0, 33, 30, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 39, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 28, 1, 0, 0, 0, 38, 39, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 41, 5, 4, 0, 0, 41, 60, 5, 5, 0, 0, 42, 43, 5, 1, 0, 0, 43, 44, 5, 51, 0, 0, 44, 55, 5, 2, 0, 0, 45, 46, 5, 1, 0, 0, 46, 52, 5, 51, 0, 0, 47, 48, 5, 3, 0, 0, 48, 49, 5, 1, 0, 0, 49, 51, 5, 51, 0, 0, 50, 47, 1, 0, 0, 0, 51, 54, 1, 0, 0, 0, 52, 50, 1, 0, 0, 0, 52, 53, 1, 0, 0, 0, 53, 56, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 55, 45, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 57, 1, 0, 0, 0, 57, 58, 5, 4, 0, 0, 58, 60, 3, 4, 2, 0, 59, 25, 1, 0, 0, 0, 59, 42, 1, 0, 0, 0, 60, 3, 1, 0, 0, 0, 61, 65, 5, 6, 0, 0, 62, 64, 3, 6, 3, 0, 63, 62, 1, 0, 0, 0, 64, 67, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, 65, 66, 1, 0, 0, 0, 66, 68, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 68, 69, 5, 7, 0, 0, 69, 5, 1, 0, 0, 0, 70, 73, 3, 8, 4, 0, 71, 73, 3, 10, 5, 0, 72, 70, 1, 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, 7, 1, 0, 0, 0, 74, 75, 5, 8, 0, 0, 75, 76, 3, 12, 6, 0, 76, 77, 5, 5, 0, 0, 77, 139, 1, 0, 0, 0, 78, 79, 5, 9, 0, 0, 79, 80, 5, 2, 0, 0, 80, 81, 3, 12, 6, 0, 81, 82, 5, 4, 0, 0, 82, 85, 3, 8, 4, 0, 83, 84, 5, 10, 0, 0, 84, 86, 3, 8, 4, 0, 85, 83, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 139, 1, 0, 0, 0, 87, 88, 5, 11, 0, 0, 88, 90, 5, 2, 0, 0, 89, 91, 3, 12, 6, 0, 90, 89, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 94, 5, 5, 0, 0, 93, 95, 3, 12, 6, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 5, 5, 0, 0, 97, 99, 3, 12, 6, 0, 98, 97, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 101, 5, 4, 0, 0, 101, 139, 3, 8, 4, 0, 102, 103, 5, 11, 0, 0, 103, 104, 5, 2, 0, 0, 104, 106, 3, 10, 5, 0, 105, 107, 3, 12, 6, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 108, 110, 5, 5, 0, 0, 109, 111, 3, 12, 6, 0, 110, 109, 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 113, 5, 4, 0, 0, 113, 114, 3, 8, 4, 0, 114, 139, 1, 0, 0, 0, 115, 116, 5, 12, 0, 0, 116, 117, 5, 2, 0, 0, 117, 118, 3, 12, 6, 0, 118, 119, 5, 4, 0, 0, 119, 120, 3, 8, 4, 0, 120, 139, 1, 0, 0, 0, 121, 122, 5, 13, 0, 0, 122, 123, 3, 8, 4, 0, 123, 124, 5, 12, 0, 0, 124, 125, 5, 2, 0, 0, 125, 126, 3, 12, 6, 0, 126, 127, 5, 4, 0, 0, 127, 128, 5, 5, 0, 0, 128, 139, 1, 0, 0, 0, 129, 130, 5, 14, 0, 0, 130, 139, 5, 5, 0, 0, 131, 132, 5, 15, 0, 0, 132, 139, 5, 5, 0, 0, 133, 134, 3, 12, 6, 0, 134, 135, 5, 5, 0, 0, 135, 139, 1, 0, 0, 0, 136, 139, 3, 4, 2, 0, 137, 139, 5, 5, 0, 0, 138, 74, 1, 0, 0, 0, 138, 78, 1, 0, 0, 0, 138, 87, 1, 0, 0, 0, 138, 102, 1, 0, 0, 0, 138, 115, 1, 0, 0, 0, 138, 121, 1, 0, 0, 0, 138, 129, 1, 0, 0, 0, 138, 131, 1, 0, 0, 0, 138, 133, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 138, 137, 1, 0, 0, 0, 139, 9, 1, 0, 0, 0, 140, 141, 5, 1, 0, 0, 141, 144, 5, 51, 0, 0, 142, 143, 5, 16, 0, 0, 143, 145, 3, 12, 6, 0, 144, 142, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 147, 5, 5, 0, 0, 147, 11, 1, 0, 0, 0, 148, 149, 6, 6, -1, 0, 149, 150, 5, 2, 0, 0, 150, 151, 3, 12, 6, 0, 151, 152, 5, 4, 0, 0, 152, 227, 1, 0, 0, 0, 153, 227, 3, 14, 7, 0, 154, 155, 3, 16, 8, 0, 155, 156, 5, 16, 0, 0, 156, 157, 3, 12, 6, 38, 157, 227, 1, 0, 0, 0, 158, 227, 5, 51, 0, 0, 159, 160, 5, 51, 0, 0, 160, 169, 5, 2, 0, 0, 161, 166, 3, 12, 6, 0, 162, 163, 5, 3, 0, 0, 163, 165, 3, 12, 6, 0, 164, 162, 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 170, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 161, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 227, 5, 4, 0, 0, 172, 173, 5, 17, 0, 0, 173, 227, 3, 12, 6, 35, 174, 175, 5, 18, 0, 0, 175, 227, 3, 12, 6, 34, 176, 177, 5, 19, 0, 0, 177, 227, 3, 16, 8, 0, 178, 179, 5, 20, 0, 0, 179, 227, 3, 16, 8, 0, 180, 181, 3, 16, 8, 0, 181, 182, 5, 19, 0, 0, 182, 227, 1, 0, 0, 0, 183, 184, 3, 16, 8, 0, 184, 185, 5, 20, 0, 0, 185, 227, 1, 0, 0, 0, 186, 187, 3, 16, 8, 0, 187, 188, 5, 39, 0, 0, 188, 189, 3, 12, 6, 11, 189, 227, 1, 0, 0, 0, 190, 191, 3, 16, 8, 0, 191, 192, 5, 40, 0, 0, 192, 193, 3, 12, 6, 10, 193, 227, 1, 0, 0, 0, 194, 195, 3, 16, 8, 0, 195, 196, 5, 41, 0, 0, 196, 197, 3, 12, 6, 9, 197, 227, 1, 0, 0, 0, 198, 199, 3, 16, 8, 0, 199, 200, 5, 42, 0, 0, 200, 201, 3, 12, 6, 8, 201, 227, 1, 0, 0, 0, 202, 203, 3, 16, 8, 0, 203, 204, 5, 43, 0, 0, 204, 205, 3, 12, 6, 7, 205, 227, 1, 0, 0, 0, 206, 207, 3, 16, 8, 0, 207, 208, 5, 44, 0, 0, 208, 209, 3, 12, 6, 6, 209, 227, 1, 0, 0, 0, 210, 211, 3, 16, 8, 0, 211, 212, 5, 45, 0, 0, 212, 213, 3, 12, 6, 5, 213, 227, 1, 0, 0, 0, 214, 215, 3, 16, 8, 0, 215, 216, 5, 46, 0, 0, 216, 217, 3, 12, 6, 4, 217, 227, 1, 0, 0, 0, 218, 219, 3, 16, 8, 0, 219, 220, 5, 47, 0, 0, 220, 221, 3, 12, 6, 3, 221, 227, 1, 0, 0, 0, 222, 223, 3, 16, 8, 0, 223, 224, 5, 48, 0, 0, 224, 225, 3, 12, 6, 2, 225, 227, 1, 0, 0, 0, 226, 148, 1, 0, 0, 0, 226, 153, 1, 0, 0, 0, 226, 154, 1, 0, 0, 0, 226, 158, 1, 0, 0, 0, 226, 159, 1, 0, 0, 0, 226, 172, 1, 0, 0, 0, 226, 174, 1, 0, 0, 0, 226, 176, 1, 0, 0, 0, 226, 178, 1, 0, 0, 0, 226, 180, 1, 0, 0, 0, 226, 183, 1, 0, 0, 0, 226, 186, 1, 0, 0, 0, 226, 190, 1, 0, 0, 0, 226, 194, 1, 0, 0, 0, 226, 198, 1, 0, 0, 0, 226, 202, 1, 0, 0, 0, 226, 206, 1, 0, 0, 0, 226, 210, 1, 0, 0, 0, 226, 214, 1, 0, 0, 0, 226, 218, 1, 0, 0, 0, 226, 222, 1, 0, 0, 0, 227, 290, 1, 0, 0, 0, 228, 229, 10, 29, 0, 0, 229, 230, 5, 21, 0, 0, 230, 289, 3, 12, 6, 30, 231, 232, 10, 28, 0, 0, 232, 233, 5, 22, 0, 0, 233, 289, 3, 12, 6, 29, 234, 235, 10, 27, 0, 0, 235, 236, 5, 23, 0, 0, 236, 289, 3, 12, 6, 28, 237, 238, 10, 26, 0, 0, 238, 239, 5, 24, 0, 0, 239, 289, 3, 12, 6, 27, 240, 241, 10, 25, 0, 0, 241, 242, 5, 25, 0, 0, 242, 289, 3, 12, 6, 26, 243, 244, 10, 24, 0, 0, 244, 245, 5, 26, 0, 0, 245, 289, 3, 12, 6, 25, 246, 247, 10, 23, 0, 0, 247, 248, 5, 27, 0, 0, 248, 289, 3, 12, 6, 24, 249, 250, 10, 22, 0, 0, 250, 251, 5, 28, 0, 0, 251, 289, 3, 12, 6, 23, 252, 253, 10, 21, 0, 0, 253, 254, 5, 29, 0, 0, 254, 289, 3, 12, 6, 22, 255, 256, 10, 20, 0, 0, 256, 257, 5, 30, 0, 0, 257, 289, 3, 12, 6, 21, 258, 259, 10, 19, 0, 0, 259, 260, 5, 31, 0, 0, 260, 289, 3, 12, 6, 20, 261, 262, 10, 18, 0, 0, 262, 263, 5, 32, 0, 0, 263, 289, 3, 12, 6, 19, 264, 265, 10, 17, 0, 0, 265, 266, 5, 33, 0, 0, 266, 289, 3, 12, 6, 18, 267, 268, 10, 16, 0, 0, 268, 269, 5, 34, 0, 0, 269, 289, 3, 12, 6, 17, 270, 271, 10, 15, 0, 0, 271, 272, 5, 35, 0, 0, 272, 289, 3, 12, 6, 16, 273, 274, 10, 14, 0, 0, 274, 275, 5, 36, 0, 0, 275, 289, 3, 12, 6, 15, 276, 277, 10, 13, 0, 0, 277, 278, 5, 37, 0, 0, 278, 289, 3, 12, 6, 14, 279, 280, 10, 12, 0, 0, 280, 281, 5, 38, 0, 0, 281, 289, 3, 12, 6, 13, 282, 283, 10, 1, 0, 0, 283, 284, 5, 49, 0, 0, 284, 285, 3, 12, 6, 0, 285, 286, 5, 50, 0, 0, 286, 287, 3, 12, 6, 2, 287, 289, 1, 0, 0, 0, 288, 228, 1, 0, 0, 0, 288, 231, 1, 0, 0, 0, 288, 234, 1, 0, 0, 0, 288, 237, 1, 0, 0, 0, 288, 240, 1, 0, 0, 0, 288, 243, 1, 0, 0, 0, 288, 246, 1, 0, 0, 0, 288, 249, 1, 0, 0, 0, 288, 252, 1, 0, 0, 0, 288, 255, 1, 0, 0, 0, 288, 258, 1, 0, 0, 0, 288, 261, 1, 0, 0, 0, 288, 264, 1, 0, 0, 0, 288, 267, 1, 0, 0, 0, 288, 270, 1, 0, 0, 0, 288, 273, 1, 0, 0, 0, 288, 276, 1, 0, 0, 0, 288, 279, 1, 0, 0, 0, 288, 282, 1, 0, 0, 0, 289, 292, 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 13, 1, 0, 0, 0, 292, 290, 1, 0, 0, 0, 293, 294, 5, 52, 0, 0, 294, 15, 1, 0, 0, 0, 295, 296, 5, 51, 0, 0, 296, 17, 1, 0, 0, 0, 21, 21, 35, 38, 52, 55, 59, 65, 72, 85, 90, 94, 98, 106, 110, 138, 144, 166, 169, 226, 288, 290]
\ No newline at end of file +[4, 1, 54, 303, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 1, 0, 4, 0, 20, 8, 0, 11, 0, 12, 0, 21, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 3, 1, 39, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 51, 8, 1, 10, 1, 12, 1, 54, 9, 1, 3, 1, 56, 8, 1, 1, 1, 1, 1, 3, 1, 60, 8, 1, 1, 2, 1, 2, 5, 2, 64, 8, 2, 10, 2, 12, 2, 67, 9, 2, 1, 2, 1, 2, 1, 3, 1, 3, 3, 3, 73, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 86, 8, 4, 1, 4, 1, 4, 1, 4, 3, 4, 91, 8, 4, 1, 4, 1, 4, 3, 4, 95, 8, 4, 1, 4, 1, 4, 3, 4, 99, 8, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 107, 8, 4, 1, 4, 1, 4, 3, 4, 111, 8, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 139, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 146, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 170, 8, 6, 10, 6, 12, 6, 173, 9, 6, 3, 6, 175, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 232, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 294, 8, 6, 10, 6, 12, 6, 297, 9, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 0, 1, 12, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 0, 0, 361, 0, 19, 1, 0, 0, 0, 2, 59, 1, 0, 0, 0, 4, 61, 1, 0, 0, 0, 6, 72, 1, 0, 0, 0, 8, 138, 1, 0, 0, 0, 10, 140, 1, 0, 0, 0, 12, 231, 1, 0, 0, 0, 14, 298, 1, 0, 0, 0, 16, 300, 1, 0, 0, 0, 18, 20, 3, 2, 1, 0, 19, 18, 1, 0, 0, 0, 20, 21, 1, 0, 0, 0, 21, 19, 1, 0, 0, 0, 21, 22, 1, 0, 0, 0, 22, 23, 1, 0, 0, 0, 23, 24, 5, 0, 0, 1, 24, 1, 1, 0, 0, 0, 25, 26, 5, 1, 0, 0, 26, 27, 5, 51, 0, 0, 27, 38, 5, 2, 0, 0, 28, 29, 5, 1, 0, 0, 29, 35, 5, 51, 0, 0, 30, 31, 5, 3, 0, 0, 31, 32, 5, 1, 0, 0, 32, 34, 5, 51, 0, 0, 33, 30, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 39, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 28, 1, 0, 0, 0, 38, 39, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 41, 5, 4, 0, 0, 41, 60, 5, 5, 0, 0, 42, 43, 5, 1, 0, 0, 43, 44, 5, 51, 0, 0, 44, 55, 5, 2, 0, 0, 45, 46, 5, 1, 0, 0, 46, 52, 5, 51, 0, 0, 47, 48, 5, 3, 0, 0, 48, 49, 5, 1, 0, 0, 49, 51, 5, 51, 0, 0, 50, 47, 1, 0, 0, 0, 51, 54, 1, 0, 0, 0, 52, 50, 1, 0, 0, 0, 52, 53, 1, 0, 0, 0, 53, 56, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 55, 45, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 57, 1, 0, 0, 0, 57, 58, 5, 4, 0, 0, 58, 60, 3, 4, 2, 0, 59, 25, 1, 0, 0, 0, 59, 42, 1, 0, 0, 0, 60, 3, 1, 0, 0, 0, 61, 65, 5, 6, 0, 0, 62, 64, 3, 6, 3, 0, 63, 62, 1, 0, 0, 0, 64, 67, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, 65, 66, 1, 0, 0, 0, 66, 68, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 68, 69, 5, 7, 0, 0, 69, 5, 1, 0, 0, 0, 70, 73, 3, 8, 4, 0, 71, 73, 3, 10, 5, 0, 72, 70, 1, 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, 7, 1, 0, 0, 0, 74, 75, 5, 8, 0, 0, 75, 76, 3, 12, 6, 0, 76, 77, 5, 5, 0, 0, 77, 139, 1, 0, 0, 0, 78, 79, 5, 9, 0, 0, 79, 80, 5, 2, 0, 0, 80, 81, 3, 12, 6, 0, 81, 82, 5, 4, 0, 0, 82, 85, 3, 8, 4, 0, 83, 84, 5, 10, 0, 0, 84, 86, 3, 8, 4, 0, 85, 83, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 139, 1, 0, 0, 0, 87, 88, 5, 11, 0, 0, 88, 90, 5, 2, 0, 0, 89, 91, 3, 12, 6, 0, 90, 89, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 94, 5, 5, 0, 0, 93, 95, 3, 12, 6, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 5, 5, 0, 0, 97, 99, 3, 12, 6, 0, 98, 97, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 101, 5, 4, 0, 0, 101, 139, 3, 8, 4, 0, 102, 103, 5, 11, 0, 0, 103, 104, 5, 2, 0, 0, 104, 106, 3, 10, 5, 0, 105, 107, 3, 12, 6, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 108, 110, 5, 5, 0, 0, 109, 111, 3, 12, 6, 0, 110, 109, 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 113, 5, 4, 0, 0, 113, 114, 3, 8, 4, 0, 114, 139, 1, 0, 0, 0, 115, 116, 5, 12, 0, 0, 116, 117, 5, 2, 0, 0, 117, 118, 3, 12, 6, 0, 118, 119, 5, 4, 0, 0, 119, 120, 3, 8, 4, 0, 120, 139, 1, 0, 0, 0, 121, 122, 5, 13, 0, 0, 122, 123, 3, 8, 4, 0, 123, 124, 5, 12, 0, 0, 124, 125, 5, 2, 0, 0, 125, 126, 3, 12, 6, 0, 126, 127, 5, 4, 0, 0, 127, 128, 5, 5, 0, 0, 128, 139, 1, 0, 0, 0, 129, 130, 5, 14, 0, 0, 130, 139, 5, 5, 0, 0, 131, 132, 5, 15, 0, 0, 132, 139, 5, 5, 0, 0, 133, 134, 3, 12, 6, 0, 134, 135, 5, 5, 0, 0, 135, 139, 1, 0, 0, 0, 136, 139, 3, 4, 2, 0, 137, 139, 5, 5, 0, 0, 138, 74, 1, 0, 0, 0, 138, 78, 1, 0, 0, 0, 138, 87, 1, 0, 0, 0, 138, 102, 1, 0, 0, 0, 138, 115, 1, 0, 0, 0, 138, 121, 1, 0, 0, 0, 138, 129, 1, 0, 0, 0, 138, 131, 1, 0, 0, 0, 138, 133, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 138, 137, 1, 0, 0, 0, 139, 9, 1, 0, 0, 0, 140, 141, 5, 1, 0, 0, 141, 142, 5, 16, 0, 0, 142, 145, 5, 51, 0, 0, 143, 144, 5, 17, 0, 0, 144, 146, 3, 12, 6, 0, 145, 143, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 148, 5, 5, 0, 0, 148, 11, 1, 0, 0, 0, 149, 150, 6, 6, -1, 0, 150, 151, 5, 2, 0, 0, 151, 152, 3, 12, 6, 0, 152, 153, 5, 4, 0, 0, 153, 232, 1, 0, 0, 0, 154, 232, 3, 14, 7, 0, 155, 156, 3, 16, 8, 0, 156, 157, 5, 17, 0, 0, 157, 158, 3, 12, 6, 40, 158, 232, 1, 0, 0, 0, 159, 160, 5, 16, 0, 0, 160, 232, 3, 12, 6, 39, 161, 162, 5, 18, 0, 0, 162, 232, 3, 16, 8, 0, 163, 232, 5, 51, 0, 0, 164, 165, 5, 51, 0, 0, 165, 174, 5, 2, 0, 0, 166, 171, 3, 12, 6, 0, 167, 168, 5, 3, 0, 0, 168, 170, 3, 12, 6, 0, 169, 167, 1, 0, 0, 0, 170, 173, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 174, 166, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 232, 5, 4, 0, 0, 177, 178, 5, 19, 0, 0, 178, 232, 3, 12, 6, 35, 179, 180, 5, 20, 0, 0, 180, 232, 3, 12, 6, 34, 181, 182, 5, 21, 0, 0, 182, 232, 3, 16, 8, 0, 183, 184, 5, 22, 0, 0, 184, 232, 3, 16, 8, 0, 185, 186, 3, 16, 8, 0, 186, 187, 5, 21, 0, 0, 187, 232, 1, 0, 0, 0, 188, 189, 3, 16, 8, 0, 189, 190, 5, 22, 0, 0, 190, 232, 1, 0, 0, 0, 191, 192, 3, 16, 8, 0, 192, 193, 5, 39, 0, 0, 193, 194, 3, 12, 6, 11, 194, 232, 1, 0, 0, 0, 195, 196, 3, 16, 8, 0, 196, 197, 5, 40, 0, 0, 197, 198, 3, 12, 6, 10, 198, 232, 1, 0, 0, 0, 199, 200, 3, 16, 8, 0, 200, 201, 5, 41, 0, 0, 201, 202, 3, 12, 6, 9, 202, 232, 1, 0, 0, 0, 203, 204, 3, 16, 8, 0, 204, 205, 5, 42, 0, 0, 205, 206, 3, 12, 6, 8, 206, 232, 1, 0, 0, 0, 207, 208, 3, 16, 8, 0, 208, 209, 5, 43, 0, 0, 209, 210, 3, 12, 6, 7, 210, 232, 1, 0, 0, 0, 211, 212, 3, 16, 8, 0, 212, 213, 5, 44, 0, 0, 213, 214, 3, 12, 6, 6, 214, 232, 1, 0, 0, 0, 215, 216, 3, 16, 8, 0, 216, 217, 5, 45, 0, 0, 217, 218, 3, 12, 6, 5, 218, 232, 1, 0, 0, 0, 219, 220, 3, 16, 8, 0, 220, 221, 5, 46, 0, 0, 221, 222, 3, 12, 6, 4, 222, 232, 1, 0, 0, 0, 223, 224, 3, 16, 8, 0, 224, 225, 5, 47, 0, 0, 225, 226, 3, 12, 6, 3, 226, 232, 1, 0, 0, 0, 227, 228, 3, 16, 8, 0, 228, 229, 5, 48, 0, 0, 229, 230, 3, 12, 6, 2, 230, 232, 1, 0, 0, 0, 231, 149, 1, 0, 0, 0, 231, 154, 1, 0, 0, 0, 231, 155, 1, 0, 0, 0, 231, 159, 1, 0, 0, 0, 231, 161, 1, 0, 0, 0, 231, 163, 1, 0, 0, 0, 231, 164, 1, 0, 0, 0, 231, 177, 1, 0, 0, 0, 231, 179, 1, 0, 0, 0, 231, 181, 1, 0, 0, 0, 231, 183, 1, 0, 0, 0, 231, 185, 1, 0, 0, 0, 231, 188, 1, 0, 0, 0, 231, 191, 1, 0, 0, 0, 231, 195, 1, 0, 0, 0, 231, 199, 1, 0, 0, 0, 231, 203, 1, 0, 0, 0, 231, 207, 1, 0, 0, 0, 231, 211, 1, 0, 0, 0, 231, 215, 1, 0, 0, 0, 231, 219, 1, 0, 0, 0, 231, 223, 1, 0, 0, 0, 231, 227, 1, 0, 0, 0, 232, 295, 1, 0, 0, 0, 233, 234, 10, 29, 0, 0, 234, 235, 5, 16, 0, 0, 235, 294, 3, 12, 6, 30, 236, 237, 10, 28, 0, 0, 237, 238, 5, 23, 0, 0, 238, 294, 3, 12, 6, 29, 239, 240, 10, 27, 0, 0, 240, 241, 5, 24, 0, 0, 241, 294, 3, 12, 6, 28, 242, 243, 10, 26, 0, 0, 243, 244, 5, 25, 0, 0, 244, 294, 3, 12, 6, 27, 245, 246, 10, 25, 0, 0, 246, 247, 5, 26, 0, 0, 247, 294, 3, 12, 6, 26, 248, 249, 10, 24, 0, 0, 249, 250, 5, 27, 0, 0, 250, 294, 3, 12, 6, 25, 251, 252, 10, 23, 0, 0, 252, 253, 5, 28, 0, 0, 253, 294, 3, 12, 6, 24, 254, 255, 10, 22, 0, 0, 255, 256, 5, 29, 0, 0, 256, 294, 3, 12, 6, 23, 257, 258, 10, 21, 0, 0, 258, 259, 5, 30, 0, 0, 259, 294, 3, 12, 6, 22, 260, 261, 10, 20, 0, 0, 261, 262, 5, 31, 0, 0, 262, 294, 3, 12, 6, 21, 263, 264, 10, 19, 0, 0, 264, 265, 5, 32, 0, 0, 265, 294, 3, 12, 6, 20, 266, 267, 10, 18, 0, 0, 267, 268, 5, 18, 0, 0, 268, 294, 3, 12, 6, 19, 269, 270, 10, 17, 0, 0, 270, 271, 5, 33, 0, 0, 271, 294, 3, 12, 6, 18, 272, 273, 10, 16, 0, 0, 273, 274, 5, 34, 0, 0, 274, 294, 3, 12, 6, 17, 275, 276, 10, 15, 0, 0, 276, 277, 5, 35, 0, 0, 277, 294, 3, 12, 6, 16, 278, 279, 10, 14, 0, 0, 279, 280, 5, 36, 0, 0, 280, 294, 3, 12, 6, 15, 281, 282, 10, 13, 0, 0, 282, 283, 5, 37, 0, 0, 283, 294, 3, 12, 6, 14, 284, 285, 10, 12, 0, 0, 285, 286, 5, 38, 0, 0, 286, 294, 3, 12, 6, 13, 287, 288, 10, 1, 0, 0, 288, 289, 5, 49, 0, 0, 289, 290, 3, 12, 6, 0, 290, 291, 5, 50, 0, 0, 291, 292, 3, 12, 6, 2, 292, 294, 1, 0, 0, 0, 293, 233, 1, 0, 0, 0, 293, 236, 1, 0, 0, 0, 293, 239, 1, 0, 0, 0, 293, 242, 1, 0, 0, 0, 293, 245, 1, 0, 0, 0, 293, 248, 1, 0, 0, 0, 293, 251, 1, 0, 0, 0, 293, 254, 1, 0, 0, 0, 293, 257, 1, 0, 0, 0, 293, 260, 1, 0, 0, 0, 293, 263, 1, 0, 0, 0, 293, 266, 1, 0, 0, 0, 293, 269, 1, 0, 0, 0, 293, 272, 1, 0, 0, 0, 293, 275, 1, 0, 0, 0, 293, 278, 1, 0, 0, 0, 293, 281, 1, 0, 0, 0, 293, 284, 1, 0, 0, 0, 293, 287, 1, 0, 0, 0, 294, 297, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 13, 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 298, 299, 5, 52, 0, 0, 299, 15, 1, 0, 0, 0, 300, 301, 5, 51, 0, 0, 301, 17, 1, 0, 0, 0, 21, 21, 35, 38, 52, 55, 59, 65, 72, 85, 90, 94, 98, 106, 110, 138, 145, 171, 174, 231, 293, 295]
\ No newline at end of file diff --git a/Compiler/gen/CGrammar.tokens b/Compiler/gen/CGrammar.tokens index 0da6b57..d575ec0 100644 --- a/Compiler/gen/CGrammar.tokens +++ b/Compiler/gen/CGrammar.tokens @@ -67,23 +67,23 @@ COMMENT=54 'do'=13 'break'=14 'continue'=15 -'='=16 -'!'=17 -'~'=18 -'++'=19 -'--'=20 -'*'=21 -'/'=22 -'%'=23 -'+'=24 -'-'=25 -'<'=26 -'>'=27 -'<='=28 -'>='=29 -'=='=30 -'!='=31 -'&'=32 +'*'=16 +'='=17 +'&'=18 +'!'=19 +'~'=20 +'++'=21 +'--'=22 +'/'=23 +'%'=24 +'+'=25 +'-'=26 +'<'=27 +'>'=28 +'<='=29 +'>='=30 +'=='=31 +'!='=32 '|'=33 '^'=34 '<<'=35 diff --git a/Compiler/gen/CGrammarBaseVisitor.cs b/Compiler/gen/CGrammarBaseVisitor.cs index 0893e73..9775583 100644 --- a/Compiler/gen/CGrammarBaseVisitor.cs +++ b/Compiler/gen/CGrammarBaseVisitor.cs @@ -219,6 +219,17 @@ public partial class CGrammarBaseVisitor<Result> : AbstractParseTreeVisitor<Resu /// <return>The visitor result.</return> public virtual Result VisitVariableDeclaration([NotNull] CGrammarParser.VariableDeclarationContext context) { return VisitChildren(context); } /// <summary> + /// Visit a parse tree produced by the <c>addressOfExpression</c> + /// labeled alternative in <see cref="CGrammarParser.expression"/>. + /// <para> + /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> + /// on <paramref name="context"/>. + /// </para> + /// </summary> + /// <param name="context">The parse tree.</param> + /// <return>The visitor result.</return> + public virtual Result VisitAddressOfExpression([NotNull] CGrammarParser.AddressOfExpressionContext context) { return VisitChildren(context); } + /// <summary> /// Visit a parse tree produced by the <c>compoundSubtractExpression</c> /// labeled alternative in <see cref="CGrammarParser.expression"/>. /// <para> @@ -417,6 +428,17 @@ public partial class CGrammarBaseVisitor<Result> : AbstractParseTreeVisitor<Resu /// <return>The visitor result.</return> public virtual Result VisitInvertExpression([NotNull] CGrammarParser.InvertExpressionContext context) { return VisitChildren(context); } /// <summary> + /// Visit a parse tree produced by the <c>dereferenceExpression</c> + /// labeled alternative in <see cref="CGrammarParser.expression"/>. + /// <para> + /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> + /// on <paramref name="context"/>. + /// </para> + /// </summary> + /// <param name="context">The parse tree.</param> + /// <return>The visitor result.</return> + public virtual Result VisitDereferenceExpression([NotNull] CGrammarParser.DereferenceExpressionContext context) { return VisitChildren(context); } + /// <summary> /// Visit a parse tree produced by the <c>equalExpression</c> /// labeled alternative in <see cref="CGrammarParser.expression"/>. /// <para> diff --git a/Compiler/gen/CGrammarLexer.cs b/Compiler/gen/CGrammarLexer.cs index 81b8945..01194e2 100644 --- a/Compiler/gen/CGrammarLexer.cs +++ b/Compiler/gen/CGrammarLexer.cs @@ -71,9 +71,9 @@ public partial class CGrammarLexer : Lexer { private static readonly string[] _LiteralNames = { null, "'int'", "'('", "','", "')'", "';'", "'{'", "'}'", "'return'", "'if'", - "'else'", "'for'", "'while'", "'do'", "'break'", "'continue'", "'='", - "'!'", "'~'", "'++'", "'--'", "'*'", "'/'", "'%'", "'+'", "'-'", "'<'", - "'>'", "'<='", "'>='", "'=='", "'!='", "'&'", "'|'", "'^'", "'<<'", "'>>'", + "'else'", "'for'", "'while'", "'do'", "'break'", "'continue'", "'*'", + "'='", "'&'", "'!'", "'~'", "'++'", "'--'", "'/'", "'%'", "'+'", "'-'", + "'<'", "'>'", "'<='", "'>='", "'=='", "'!='", "'|'", "'^'", "'<<'", "'>>'", "'&&'", "'||'", "'*='", "'/='", "'%='", "'+='", "'-='", "'&='", "'|='", "'^='", "'<<='", "'>>='", "'?'", "':'" }; @@ -124,9 +124,9 @@ public partial class CGrammarLexer : Lexer { 1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1, 11,1,11,1,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,14,1, 14,1,14,1,14,1,14,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,18,1,18,1, - 18,1,19,1,19,1,19,1,20,1,20,1,21,1,21,1,22,1,22,1,23,1,23,1,24,1,24,1, - 25,1,25,1,26,1,26,1,27,1,27,1,27,1,28,1,28,1,28,1,29,1,29,1,29,1,30,1, - 30,1,30,1,31,1,31,1,32,1,32,1,33,1,33,1,34,1,34,1,34,1,35,1,35,1,35,1, + 19,1,19,1,20,1,20,1,20,1,21,1,21,1,21,1,22,1,22,1,23,1,23,1,24,1,24,1, + 25,1,25,1,26,1,26,1,27,1,27,1,28,1,28,1,28,1,29,1,29,1,29,1,30,1,30,1, + 30,1,31,1,31,1,31,1,32,1,32,1,33,1,33,1,34,1,34,1,34,1,35,1,35,1,35,1, 36,1,36,1,36,1,37,1,37,1,37,1,38,1,38,1,38,1,39,1,39,1,39,1,40,1,40,1, 40,1,41,1,41,1,41,1,42,1,42,1,42,1,43,1,43,1,43,1,44,1,44,1,44,1,45,1, 45,1,45,1,46,1,46,1,46,1,46,1,47,1,47,1,47,1,47,1,48,1,48,1,49,1,49,1, @@ -152,10 +152,10 @@ public partial class CGrammarLexer : Lexer { 1,0,0,0,5,115,1,0,0,0,7,117,1,0,0,0,9,119,1,0,0,0,11,121,1,0,0,0,13,123, 1,0,0,0,15,125,1,0,0,0,17,132,1,0,0,0,19,135,1,0,0,0,21,140,1,0,0,0,23, 144,1,0,0,0,25,150,1,0,0,0,27,153,1,0,0,0,29,159,1,0,0,0,31,168,1,0,0, - 0,33,170,1,0,0,0,35,172,1,0,0,0,37,174,1,0,0,0,39,177,1,0,0,0,41,180,1, - 0,0,0,43,182,1,0,0,0,45,184,1,0,0,0,47,186,1,0,0,0,49,188,1,0,0,0,51,190, - 1,0,0,0,53,192,1,0,0,0,55,194,1,0,0,0,57,197,1,0,0,0,59,200,1,0,0,0,61, - 203,1,0,0,0,63,206,1,0,0,0,65,208,1,0,0,0,67,210,1,0,0,0,69,212,1,0,0, + 0,33,170,1,0,0,0,35,172,1,0,0,0,37,174,1,0,0,0,39,176,1,0,0,0,41,178,1, + 0,0,0,43,181,1,0,0,0,45,184,1,0,0,0,47,186,1,0,0,0,49,188,1,0,0,0,51,190, + 1,0,0,0,53,192,1,0,0,0,55,194,1,0,0,0,57,196,1,0,0,0,59,199,1,0,0,0,61, + 202,1,0,0,0,63,205,1,0,0,0,65,208,1,0,0,0,67,210,1,0,0,0,69,212,1,0,0, 0,71,215,1,0,0,0,73,218,1,0,0,0,75,221,1,0,0,0,77,224,1,0,0,0,79,227,1, 0,0,0,81,230,1,0,0,0,83,233,1,0,0,0,85,236,1,0,0,0,87,239,1,0,0,0,89,242, 1,0,0,0,91,245,1,0,0,0,93,248,1,0,0,0,95,252,1,0,0,0,97,256,1,0,0,0,99, @@ -174,16 +174,16 @@ public partial class CGrammarLexer : Lexer { 0,155,156,5,101,0,0,156,157,5,97,0,0,157,158,5,107,0,0,158,28,1,0,0,0, 159,160,5,99,0,0,160,161,5,111,0,0,161,162,5,110,0,0,162,163,5,116,0,0, 163,164,5,105,0,0,164,165,5,110,0,0,165,166,5,117,0,0,166,167,5,101,0, - 0,167,30,1,0,0,0,168,169,5,61,0,0,169,32,1,0,0,0,170,171,5,33,0,0,171, - 34,1,0,0,0,172,173,5,126,0,0,173,36,1,0,0,0,174,175,5,43,0,0,175,176,5, - 43,0,0,176,38,1,0,0,0,177,178,5,45,0,0,178,179,5,45,0,0,179,40,1,0,0,0, - 180,181,5,42,0,0,181,42,1,0,0,0,182,183,5,47,0,0,183,44,1,0,0,0,184,185, - 5,37,0,0,185,46,1,0,0,0,186,187,5,43,0,0,187,48,1,0,0,0,188,189,5,45,0, - 0,189,50,1,0,0,0,190,191,5,60,0,0,191,52,1,0,0,0,192,193,5,62,0,0,193, - 54,1,0,0,0,194,195,5,60,0,0,195,196,5,61,0,0,196,56,1,0,0,0,197,198,5, - 62,0,0,198,199,5,61,0,0,199,58,1,0,0,0,200,201,5,61,0,0,201,202,5,61,0, - 0,202,60,1,0,0,0,203,204,5,33,0,0,204,205,5,61,0,0,205,62,1,0,0,0,206, - 207,5,38,0,0,207,64,1,0,0,0,208,209,5,124,0,0,209,66,1,0,0,0,210,211,5, + 0,167,30,1,0,0,0,168,169,5,42,0,0,169,32,1,0,0,0,170,171,5,61,0,0,171, + 34,1,0,0,0,172,173,5,38,0,0,173,36,1,0,0,0,174,175,5,33,0,0,175,38,1,0, + 0,0,176,177,5,126,0,0,177,40,1,0,0,0,178,179,5,43,0,0,179,180,5,43,0,0, + 180,42,1,0,0,0,181,182,5,45,0,0,182,183,5,45,0,0,183,44,1,0,0,0,184,185, + 5,47,0,0,185,46,1,0,0,0,186,187,5,37,0,0,187,48,1,0,0,0,188,189,5,43,0, + 0,189,50,1,0,0,0,190,191,5,45,0,0,191,52,1,0,0,0,192,193,5,60,0,0,193, + 54,1,0,0,0,194,195,5,62,0,0,195,56,1,0,0,0,196,197,5,60,0,0,197,198,5, + 61,0,0,198,58,1,0,0,0,199,200,5,62,0,0,200,201,5,61,0,0,201,60,1,0,0,0, + 202,203,5,61,0,0,203,204,5,61,0,0,204,62,1,0,0,0,205,206,5,33,0,0,206, + 207,5,61,0,0,207,64,1,0,0,0,208,209,5,124,0,0,209,66,1,0,0,0,210,211,5, 94,0,0,211,68,1,0,0,0,212,213,5,60,0,0,213,214,5,60,0,0,214,70,1,0,0,0, 215,216,5,62,0,0,216,217,5,62,0,0,217,72,1,0,0,0,218,219,5,38,0,0,219, 220,5,38,0,0,220,74,1,0,0,0,221,222,5,124,0,0,222,223,5,124,0,0,223,76, diff --git a/Compiler/gen/CGrammarLexer.interp b/Compiler/gen/CGrammarLexer.interp index 474d0f9..95372cb 100644 --- a/Compiler/gen/CGrammarLexer.interp +++ b/Compiler/gen/CGrammarLexer.interp @@ -15,12 +15,13 @@ null 'do' 'break' 'continue' +'*' '=' +'&' '!' '~' '++' '--' -'*' '/' '%' '+' @@ -31,7 +32,6 @@ null '>=' '==' '!=' -'&' '|' '^' '<<' @@ -176,4 +176,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 54, 293, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, 50, 1, 50, 5, 50, 263, 8, 50, 10, 50, 12, 50, 266, 9, 50, 1, 51, 4, 51, 269, 8, 51, 11, 51, 12, 51, 270, 1, 52, 4, 52, 274, 8, 52, 11, 52, 12, 52, 275, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 5, 53, 284, 8, 53, 10, 53, 12, 53, 287, 9, 53, 1, 53, 3, 53, 290, 8, 53, 1, 53, 1, 53, 1, 285, 0, 54, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 1, 0, 5, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 3, 0, 9, 10, 13, 13, 32, 32, 1, 1, 10, 10, 296, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 1, 109, 1, 0, 0, 0, 3, 113, 1, 0, 0, 0, 5, 115, 1, 0, 0, 0, 7, 117, 1, 0, 0, 0, 9, 119, 1, 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 123, 1, 0, 0, 0, 15, 125, 1, 0, 0, 0, 17, 132, 1, 0, 0, 0, 19, 135, 1, 0, 0, 0, 21, 140, 1, 0, 0, 0, 23, 144, 1, 0, 0, 0, 25, 150, 1, 0, 0, 0, 27, 153, 1, 0, 0, 0, 29, 159, 1, 0, 0, 0, 31, 168, 1, 0, 0, 0, 33, 170, 1, 0, 0, 0, 35, 172, 1, 0, 0, 0, 37, 174, 1, 0, 0, 0, 39, 177, 1, 0, 0, 0, 41, 180, 1, 0, 0, 0, 43, 182, 1, 0, 0, 0, 45, 184, 1, 0, 0, 0, 47, 186, 1, 0, 0, 0, 49, 188, 1, 0, 0, 0, 51, 190, 1, 0, 0, 0, 53, 192, 1, 0, 0, 0, 55, 194, 1, 0, 0, 0, 57, 197, 1, 0, 0, 0, 59, 200, 1, 0, 0, 0, 61, 203, 1, 0, 0, 0, 63, 206, 1, 0, 0, 0, 65, 208, 1, 0, 0, 0, 67, 210, 1, 0, 0, 0, 69, 212, 1, 0, 0, 0, 71, 215, 1, 0, 0, 0, 73, 218, 1, 0, 0, 0, 75, 221, 1, 0, 0, 0, 77, 224, 1, 0, 0, 0, 79, 227, 1, 0, 0, 0, 81, 230, 1, 0, 0, 0, 83, 233, 1, 0, 0, 0, 85, 236, 1, 0, 0, 0, 87, 239, 1, 0, 0, 0, 89, 242, 1, 0, 0, 0, 91, 245, 1, 0, 0, 0, 93, 248, 1, 0, 0, 0, 95, 252, 1, 0, 0, 0, 97, 256, 1, 0, 0, 0, 99, 258, 1, 0, 0, 0, 101, 260, 1, 0, 0, 0, 103, 268, 1, 0, 0, 0, 105, 273, 1, 0, 0, 0, 107, 279, 1, 0, 0, 0, 109, 110, 5, 105, 0, 0, 110, 111, 5, 110, 0, 0, 111, 112, 5, 116, 0, 0, 112, 2, 1, 0, 0, 0, 113, 114, 5, 40, 0, 0, 114, 4, 1, 0, 0, 0, 115, 116, 5, 44, 0, 0, 116, 6, 1, 0, 0, 0, 117, 118, 5, 41, 0, 0, 118, 8, 1, 0, 0, 0, 119, 120, 5, 59, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, 123, 0, 0, 122, 12, 1, 0, 0, 0, 123, 124, 5, 125, 0, 0, 124, 14, 1, 0, 0, 0, 125, 126, 5, 114, 0, 0, 126, 127, 5, 101, 0, 0, 127, 128, 5, 116, 0, 0, 128, 129, 5, 117, 0, 0, 129, 130, 5, 114, 0, 0, 130, 131, 5, 110, 0, 0, 131, 16, 1, 0, 0, 0, 132, 133, 5, 105, 0, 0, 133, 134, 5, 102, 0, 0, 134, 18, 1, 0, 0, 0, 135, 136, 5, 101, 0, 0, 136, 137, 5, 108, 0, 0, 137, 138, 5, 115, 0, 0, 138, 139, 5, 101, 0, 0, 139, 20, 1, 0, 0, 0, 140, 141, 5, 102, 0, 0, 141, 142, 5, 111, 0, 0, 142, 143, 5, 114, 0, 0, 143, 22, 1, 0, 0, 0, 144, 145, 5, 119, 0, 0, 145, 146, 5, 104, 0, 0, 146, 147, 5, 105, 0, 0, 147, 148, 5, 108, 0, 0, 148, 149, 5, 101, 0, 0, 149, 24, 1, 0, 0, 0, 150, 151, 5, 100, 0, 0, 151, 152, 5, 111, 0, 0, 152, 26, 1, 0, 0, 0, 153, 154, 5, 98, 0, 0, 154, 155, 5, 114, 0, 0, 155, 156, 5, 101, 0, 0, 156, 157, 5, 97, 0, 0, 157, 158, 5, 107, 0, 0, 158, 28, 1, 0, 0, 0, 159, 160, 5, 99, 0, 0, 160, 161, 5, 111, 0, 0, 161, 162, 5, 110, 0, 0, 162, 163, 5, 116, 0, 0, 163, 164, 5, 105, 0, 0, 164, 165, 5, 110, 0, 0, 165, 166, 5, 117, 0, 0, 166, 167, 5, 101, 0, 0, 167, 30, 1, 0, 0, 0, 168, 169, 5, 61, 0, 0, 169, 32, 1, 0, 0, 0, 170, 171, 5, 33, 0, 0, 171, 34, 1, 0, 0, 0, 172, 173, 5, 126, 0, 0, 173, 36, 1, 0, 0, 0, 174, 175, 5, 43, 0, 0, 175, 176, 5, 43, 0, 0, 176, 38, 1, 0, 0, 0, 177, 178, 5, 45, 0, 0, 178, 179, 5, 45, 0, 0, 179, 40, 1, 0, 0, 0, 180, 181, 5, 42, 0, 0, 181, 42, 1, 0, 0, 0, 182, 183, 5, 47, 0, 0, 183, 44, 1, 0, 0, 0, 184, 185, 5, 37, 0, 0, 185, 46, 1, 0, 0, 0, 186, 187, 5, 43, 0, 0, 187, 48, 1, 0, 0, 0, 188, 189, 5, 45, 0, 0, 189, 50, 1, 0, 0, 0, 190, 191, 5, 60, 0, 0, 191, 52, 1, 0, 0, 0, 192, 193, 5, 62, 0, 0, 193, 54, 1, 0, 0, 0, 194, 195, 5, 60, 0, 0, 195, 196, 5, 61, 0, 0, 196, 56, 1, 0, 0, 0, 197, 198, 5, 62, 0, 0, 198, 199, 5, 61, 0, 0, 199, 58, 1, 0, 0, 0, 200, 201, 5, 61, 0, 0, 201, 202, 5, 61, 0, 0, 202, 60, 1, 0, 0, 0, 203, 204, 5, 33, 0, 0, 204, 205, 5, 61, 0, 0, 205, 62, 1, 0, 0, 0, 206, 207, 5, 38, 0, 0, 207, 64, 1, 0, 0, 0, 208, 209, 5, 124, 0, 0, 209, 66, 1, 0, 0, 0, 210, 211, 5, 94, 0, 0, 211, 68, 1, 0, 0, 0, 212, 213, 5, 60, 0, 0, 213, 214, 5, 60, 0, 0, 214, 70, 1, 0, 0, 0, 215, 216, 5, 62, 0, 0, 216, 217, 5, 62, 0, 0, 217, 72, 1, 0, 0, 0, 218, 219, 5, 38, 0, 0, 219, 220, 5, 38, 0, 0, 220, 74, 1, 0, 0, 0, 221, 222, 5, 124, 0, 0, 222, 223, 5, 124, 0, 0, 223, 76, 1, 0, 0, 0, 224, 225, 5, 42, 0, 0, 225, 226, 5, 61, 0, 0, 226, 78, 1, 0, 0, 0, 227, 228, 5, 47, 0, 0, 228, 229, 5, 61, 0, 0, 229, 80, 1, 0, 0, 0, 230, 231, 5, 37, 0, 0, 231, 232, 5, 61, 0, 0, 232, 82, 1, 0, 0, 0, 233, 234, 5, 43, 0, 0, 234, 235, 5, 61, 0, 0, 235, 84, 1, 0, 0, 0, 236, 237, 5, 45, 0, 0, 237, 238, 5, 61, 0, 0, 238, 86, 1, 0, 0, 0, 239, 240, 5, 38, 0, 0, 240, 241, 5, 61, 0, 0, 241, 88, 1, 0, 0, 0, 242, 243, 5, 124, 0, 0, 243, 244, 5, 61, 0, 0, 244, 90, 1, 0, 0, 0, 245, 246, 5, 94, 0, 0, 246, 247, 5, 61, 0, 0, 247, 92, 1, 0, 0, 0, 248, 249, 5, 60, 0, 0, 249, 250, 5, 60, 0, 0, 250, 251, 5, 61, 0, 0, 251, 94, 1, 0, 0, 0, 252, 253, 5, 62, 0, 0, 253, 254, 5, 62, 0, 0, 254, 255, 5, 61, 0, 0, 255, 96, 1, 0, 0, 0, 256, 257, 5, 63, 0, 0, 257, 98, 1, 0, 0, 0, 258, 259, 5, 58, 0, 0, 259, 100, 1, 0, 0, 0, 260, 264, 7, 0, 0, 0, 261, 263, 7, 1, 0, 0, 262, 261, 1, 0, 0, 0, 263, 266, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 102, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 267, 269, 7, 2, 0, 0, 268, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 104, 1, 0, 0, 0, 272, 274, 7, 3, 0, 0, 273, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 278, 6, 52, 0, 0, 278, 106, 1, 0, 0, 0, 279, 280, 5, 47, 0, 0, 280, 281, 5, 47, 0, 0, 281, 285, 1, 0, 0, 0, 282, 284, 9, 0, 0, 0, 283, 282, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 286, 289, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 288, 290, 7, 4, 0, 0, 289, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 292, 6, 53, 1, 0, 292, 108, 1, 0, 0, 0, 6, 0, 264, 270, 275, 285, 289, 2, 6, 0, 0, 0, 1, 0]
\ No newline at end of file +[4, 0, 54, 293, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, 50, 1, 50, 5, 50, 263, 8, 50, 10, 50, 12, 50, 266, 9, 50, 1, 51, 4, 51, 269, 8, 51, 11, 51, 12, 51, 270, 1, 52, 4, 52, 274, 8, 52, 11, 52, 12, 52, 275, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 5, 53, 284, 8, 53, 10, 53, 12, 53, 287, 9, 53, 1, 53, 3, 53, 290, 8, 53, 1, 53, 1, 53, 1, 285, 0, 54, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 1, 0, 5, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 3, 0, 9, 10, 13, 13, 32, 32, 1, 1, 10, 10, 296, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 1, 109, 1, 0, 0, 0, 3, 113, 1, 0, 0, 0, 5, 115, 1, 0, 0, 0, 7, 117, 1, 0, 0, 0, 9, 119, 1, 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 123, 1, 0, 0, 0, 15, 125, 1, 0, 0, 0, 17, 132, 1, 0, 0, 0, 19, 135, 1, 0, 0, 0, 21, 140, 1, 0, 0, 0, 23, 144, 1, 0, 0, 0, 25, 150, 1, 0, 0, 0, 27, 153, 1, 0, 0, 0, 29, 159, 1, 0, 0, 0, 31, 168, 1, 0, 0, 0, 33, 170, 1, 0, 0, 0, 35, 172, 1, 0, 0, 0, 37, 174, 1, 0, 0, 0, 39, 176, 1, 0, 0, 0, 41, 178, 1, 0, 0, 0, 43, 181, 1, 0, 0, 0, 45, 184, 1, 0, 0, 0, 47, 186, 1, 0, 0, 0, 49, 188, 1, 0, 0, 0, 51, 190, 1, 0, 0, 0, 53, 192, 1, 0, 0, 0, 55, 194, 1, 0, 0, 0, 57, 196, 1, 0, 0, 0, 59, 199, 1, 0, 0, 0, 61, 202, 1, 0, 0, 0, 63, 205, 1, 0, 0, 0, 65, 208, 1, 0, 0, 0, 67, 210, 1, 0, 0, 0, 69, 212, 1, 0, 0, 0, 71, 215, 1, 0, 0, 0, 73, 218, 1, 0, 0, 0, 75, 221, 1, 0, 0, 0, 77, 224, 1, 0, 0, 0, 79, 227, 1, 0, 0, 0, 81, 230, 1, 0, 0, 0, 83, 233, 1, 0, 0, 0, 85, 236, 1, 0, 0, 0, 87, 239, 1, 0, 0, 0, 89, 242, 1, 0, 0, 0, 91, 245, 1, 0, 0, 0, 93, 248, 1, 0, 0, 0, 95, 252, 1, 0, 0, 0, 97, 256, 1, 0, 0, 0, 99, 258, 1, 0, 0, 0, 101, 260, 1, 0, 0, 0, 103, 268, 1, 0, 0, 0, 105, 273, 1, 0, 0, 0, 107, 279, 1, 0, 0, 0, 109, 110, 5, 105, 0, 0, 110, 111, 5, 110, 0, 0, 111, 112, 5, 116, 0, 0, 112, 2, 1, 0, 0, 0, 113, 114, 5, 40, 0, 0, 114, 4, 1, 0, 0, 0, 115, 116, 5, 44, 0, 0, 116, 6, 1, 0, 0, 0, 117, 118, 5, 41, 0, 0, 118, 8, 1, 0, 0, 0, 119, 120, 5, 59, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, 123, 0, 0, 122, 12, 1, 0, 0, 0, 123, 124, 5, 125, 0, 0, 124, 14, 1, 0, 0, 0, 125, 126, 5, 114, 0, 0, 126, 127, 5, 101, 0, 0, 127, 128, 5, 116, 0, 0, 128, 129, 5, 117, 0, 0, 129, 130, 5, 114, 0, 0, 130, 131, 5, 110, 0, 0, 131, 16, 1, 0, 0, 0, 132, 133, 5, 105, 0, 0, 133, 134, 5, 102, 0, 0, 134, 18, 1, 0, 0, 0, 135, 136, 5, 101, 0, 0, 136, 137, 5, 108, 0, 0, 137, 138, 5, 115, 0, 0, 138, 139, 5, 101, 0, 0, 139, 20, 1, 0, 0, 0, 140, 141, 5, 102, 0, 0, 141, 142, 5, 111, 0, 0, 142, 143, 5, 114, 0, 0, 143, 22, 1, 0, 0, 0, 144, 145, 5, 119, 0, 0, 145, 146, 5, 104, 0, 0, 146, 147, 5, 105, 0, 0, 147, 148, 5, 108, 0, 0, 148, 149, 5, 101, 0, 0, 149, 24, 1, 0, 0, 0, 150, 151, 5, 100, 0, 0, 151, 152, 5, 111, 0, 0, 152, 26, 1, 0, 0, 0, 153, 154, 5, 98, 0, 0, 154, 155, 5, 114, 0, 0, 155, 156, 5, 101, 0, 0, 156, 157, 5, 97, 0, 0, 157, 158, 5, 107, 0, 0, 158, 28, 1, 0, 0, 0, 159, 160, 5, 99, 0, 0, 160, 161, 5, 111, 0, 0, 161, 162, 5, 110, 0, 0, 162, 163, 5, 116, 0, 0, 163, 164, 5, 105, 0, 0, 164, 165, 5, 110, 0, 0, 165, 166, 5, 117, 0, 0, 166, 167, 5, 101, 0, 0, 167, 30, 1, 0, 0, 0, 168, 169, 5, 42, 0, 0, 169, 32, 1, 0, 0, 0, 170, 171, 5, 61, 0, 0, 171, 34, 1, 0, 0, 0, 172, 173, 5, 38, 0, 0, 173, 36, 1, 0, 0, 0, 174, 175, 5, 33, 0, 0, 175, 38, 1, 0, 0, 0, 176, 177, 5, 126, 0, 0, 177, 40, 1, 0, 0, 0, 178, 179, 5, 43, 0, 0, 179, 180, 5, 43, 0, 0, 180, 42, 1, 0, 0, 0, 181, 182, 5, 45, 0, 0, 182, 183, 5, 45, 0, 0, 183, 44, 1, 0, 0, 0, 184, 185, 5, 47, 0, 0, 185, 46, 1, 0, 0, 0, 186, 187, 5, 37, 0, 0, 187, 48, 1, 0, 0, 0, 188, 189, 5, 43, 0, 0, 189, 50, 1, 0, 0, 0, 190, 191, 5, 45, 0, 0, 191, 52, 1, 0, 0, 0, 192, 193, 5, 60, 0, 0, 193, 54, 1, 0, 0, 0, 194, 195, 5, 62, 0, 0, 195, 56, 1, 0, 0, 0, 196, 197, 5, 60, 0, 0, 197, 198, 5, 61, 0, 0, 198, 58, 1, 0, 0, 0, 199, 200, 5, 62, 0, 0, 200, 201, 5, 61, 0, 0, 201, 60, 1, 0, 0, 0, 202, 203, 5, 61, 0, 0, 203, 204, 5, 61, 0, 0, 204, 62, 1, 0, 0, 0, 205, 206, 5, 33, 0, 0, 206, 207, 5, 61, 0, 0, 207, 64, 1, 0, 0, 0, 208, 209, 5, 124, 0, 0, 209, 66, 1, 0, 0, 0, 210, 211, 5, 94, 0, 0, 211, 68, 1, 0, 0, 0, 212, 213, 5, 60, 0, 0, 213, 214, 5, 60, 0, 0, 214, 70, 1, 0, 0, 0, 215, 216, 5, 62, 0, 0, 216, 217, 5, 62, 0, 0, 217, 72, 1, 0, 0, 0, 218, 219, 5, 38, 0, 0, 219, 220, 5, 38, 0, 0, 220, 74, 1, 0, 0, 0, 221, 222, 5, 124, 0, 0, 222, 223, 5, 124, 0, 0, 223, 76, 1, 0, 0, 0, 224, 225, 5, 42, 0, 0, 225, 226, 5, 61, 0, 0, 226, 78, 1, 0, 0, 0, 227, 228, 5, 47, 0, 0, 228, 229, 5, 61, 0, 0, 229, 80, 1, 0, 0, 0, 230, 231, 5, 37, 0, 0, 231, 232, 5, 61, 0, 0, 232, 82, 1, 0, 0, 0, 233, 234, 5, 43, 0, 0, 234, 235, 5, 61, 0, 0, 235, 84, 1, 0, 0, 0, 236, 237, 5, 45, 0, 0, 237, 238, 5, 61, 0, 0, 238, 86, 1, 0, 0, 0, 239, 240, 5, 38, 0, 0, 240, 241, 5, 61, 0, 0, 241, 88, 1, 0, 0, 0, 242, 243, 5, 124, 0, 0, 243, 244, 5, 61, 0, 0, 244, 90, 1, 0, 0, 0, 245, 246, 5, 94, 0, 0, 246, 247, 5, 61, 0, 0, 247, 92, 1, 0, 0, 0, 248, 249, 5, 60, 0, 0, 249, 250, 5, 60, 0, 0, 250, 251, 5, 61, 0, 0, 251, 94, 1, 0, 0, 0, 252, 253, 5, 62, 0, 0, 253, 254, 5, 62, 0, 0, 254, 255, 5, 61, 0, 0, 255, 96, 1, 0, 0, 0, 256, 257, 5, 63, 0, 0, 257, 98, 1, 0, 0, 0, 258, 259, 5, 58, 0, 0, 259, 100, 1, 0, 0, 0, 260, 264, 7, 0, 0, 0, 261, 263, 7, 1, 0, 0, 262, 261, 1, 0, 0, 0, 263, 266, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 102, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 267, 269, 7, 2, 0, 0, 268, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 104, 1, 0, 0, 0, 272, 274, 7, 3, 0, 0, 273, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 278, 6, 52, 0, 0, 278, 106, 1, 0, 0, 0, 279, 280, 5, 47, 0, 0, 280, 281, 5, 47, 0, 0, 281, 285, 1, 0, 0, 0, 282, 284, 9, 0, 0, 0, 283, 282, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 286, 289, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 288, 290, 7, 4, 0, 0, 289, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 292, 6, 53, 1, 0, 292, 108, 1, 0, 0, 0, 6, 0, 264, 270, 275, 285, 289, 2, 6, 0, 0, 0, 1, 0]
\ No newline at end of file diff --git a/Compiler/gen/CGrammarLexer.tokens b/Compiler/gen/CGrammarLexer.tokens index 0da6b57..d575ec0 100644 --- a/Compiler/gen/CGrammarLexer.tokens +++ b/Compiler/gen/CGrammarLexer.tokens @@ -67,23 +67,23 @@ COMMENT=54 'do'=13 'break'=14 'continue'=15 -'='=16 -'!'=17 -'~'=18 -'++'=19 -'--'=20 -'*'=21 -'/'=22 -'%'=23 -'+'=24 -'-'=25 -'<'=26 -'>'=27 -'<='=28 -'>='=29 -'=='=30 -'!='=31 -'&'=32 +'*'=16 +'='=17 +'&'=18 +'!'=19 +'~'=20 +'++'=21 +'--'=22 +'/'=23 +'%'=24 +'+'=25 +'-'=26 +'<'=27 +'>'=28 +'<='=29 +'>='=30 +'=='=31 +'!='=32 '|'=33 '^'=34 '<<'=35 diff --git a/Compiler/gen/CGrammarParser.cs b/Compiler/gen/CGrammarParser.cs index 184d28e..4ffaf81 100644 --- a/Compiler/gen/CGrammarParser.cs +++ b/Compiler/gen/CGrammarParser.cs @@ -55,9 +55,9 @@ public partial class CGrammarParser : Parser { private static readonly string[] _LiteralNames = { null, "'int'", "'('", "','", "')'", "';'", "'{'", "'}'", "'return'", "'if'", - "'else'", "'for'", "'while'", "'do'", "'break'", "'continue'", "'='", - "'!'", "'~'", "'++'", "'--'", "'*'", "'/'", "'%'", "'+'", "'-'", "'<'", - "'>'", "'<='", "'>='", "'=='", "'!='", "'&'", "'|'", "'^'", "'<<'", "'>>'", + "'else'", "'for'", "'while'", "'do'", "'break'", "'continue'", "'*'", + "'='", "'&'", "'!'", "'~'", "'++'", "'--'", "'/'", "'%'", "'+'", "'-'", + "'<'", "'>'", "'<='", "'>='", "'=='", "'!='", "'|'", "'^'", "'<<'", "'>>'", "'&&'", "'||'", "'*='", "'/='", "'%='", "'+='", "'-='", "'&='", "'|='", "'^='", "'<<='", "'>>='", "'?'", "':'" }; @@ -365,7 +365,7 @@ public partial class CGrammarParser : Parser { State = 65; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399443086182L) != 0)) { + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399449312102L) != 0)) { { { State = 62; @@ -429,10 +429,12 @@ public partial class CGrammarParser : Parser { case T__12: case T__13: case T__14: - case T__16: + case T__15: case T__17: case T__18: case T__19: + case T__20: + case T__21: case ID: case INT: EnterOuterAlt(_localctx, 1); @@ -700,7 +702,7 @@ public partial class CGrammarParser : Parser { State = 90; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399443021828L) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399449247748L) != 0)) { { State = 89; ((ForExprStatementContext)_localctx).initializer = expression(0); @@ -712,7 +714,7 @@ public partial class CGrammarParser : Parser { State = 94; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399443021828L) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399449247748L) != 0)) { { State = 93; ((ForExprStatementContext)_localctx).cond = expression(0); @@ -724,7 +726,7 @@ public partial class CGrammarParser : Parser { State = 98; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399443021828L) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399449247748L) != 0)) { { State = 97; ((ForExprStatementContext)_localctx).post = expression(0); @@ -750,7 +752,7 @@ public partial class CGrammarParser : Parser { State = 106; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399443021828L) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399449247748L) != 0)) { { State = 105; ((ForDeclStatementContext)_localctx).cond = expression(0); @@ -762,7 +764,7 @@ public partial class CGrammarParser : Parser { State = 110; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399443021828L) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399449247748L) != 0)) { { State = 109; ((ForDeclStatementContext)_localctx).post = expression(0); @@ -883,6 +885,7 @@ public partial class CGrammarParser : Parser { } } public partial class VariableDeclarationContext : DeclarationContext { + public IToken ptr; public IToken name; public ExpressionContext value; [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID() { return GetToken(CGrammarParser.ID, 0); } @@ -910,20 +913,22 @@ public partial class CGrammarParser : Parser { State = 140; Match(T__0); State = 141; + ((VariableDeclarationContext)_localctx).ptr = Match(T__15); + State = 142; ((VariableDeclarationContext)_localctx).name = Match(ID); - State = 144; + State = 145; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if (_la==T__15) { + if (_la==T__16) { { - State = 142; - Match(T__15); State = 143; + Match(T__16); + State = 144; ((VariableDeclarationContext)_localctx).value = expression(0); } } - State = 146; + State = 147; Match(T__4); } } @@ -950,6 +955,18 @@ public partial class CGrammarParser : Parser { base.CopyFrom(context); } } + public partial class AddressOfExpressionContext : ExpressionContext { + [System.Diagnostics.DebuggerNonUserCode] public TargetContext target() { + return GetRuleContext<TargetContext>(0); + } + public AddressOfExpressionContext(ExpressionContext context) { CopyFrom(context); } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) { + ICGrammarVisitor<TResult> typedVisitor = visitor as ICGrammarVisitor<TResult>; + if (typedVisitor != null) return typedVisitor.VisitAddressOfExpression(this); + else return visitor.VisitChildren(this); + } + } public partial class CompoundSubtractExpressionContext : ExpressionContext { [System.Diagnostics.DebuggerNonUserCode] public TargetContext target() { return GetRuleContext<TargetContext>(0); @@ -1219,6 +1236,18 @@ public partial class CGrammarParser : Parser { else return visitor.VisitChildren(this); } } + public partial class DereferenceExpressionContext : ExpressionContext { + [System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() { + return GetRuleContext<ExpressionContext>(0); + } + public DereferenceExpressionContext(ExpressionContext context) { CopyFrom(context); } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) { + ICGrammarVisitor<TResult> typedVisitor = visitor as ICGrammarVisitor<TResult>; + if (typedVisitor != null) return typedVisitor.VisitDereferenceExpression(this); + else return visitor.VisitChildren(this); + } + } public partial class EqualExpressionContext : ExpressionContext { public ExpressionContext left; public ExpressionContext right; @@ -1581,7 +1610,7 @@ public partial class CGrammarParser : Parser { int _alt; EnterOuterAlt(_localctx, 1); { - State = 226; + State = 231; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,18,Context) ) { case 1: @@ -1590,11 +1619,11 @@ public partial class CGrammarParser : Parser { Context = _localctx; _prevctx = _localctx; - State = 149; - Match(T__1); State = 150; - expression(0); + Match(T__1); State = 151; + expression(0); + State = 152; Match(T__3); } break; @@ -1603,7 +1632,7 @@ public partial class CGrammarParser : Parser { _localctx = new ConstantExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 153; + State = 154; constant(); } break; @@ -1612,263 +1641,285 @@ public partial class CGrammarParser : Parser { _localctx = new AssignmentExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 154; - target(); State = 155; - Match(T__15); + target(); State = 156; - expression(38); + Match(T__16); + State = 157; + expression(40); } break; case 4: { + _localctx = new DereferenceExpressionContext(_localctx); + Context = _localctx; + _prevctx = _localctx; + State = 159; + Match(T__15); + State = 160; + expression(39); + } + break; + case 5: + { + _localctx = new AddressOfExpressionContext(_localctx); + Context = _localctx; + _prevctx = _localctx; + State = 161; + Match(T__17); + State = 162; + target(); + } + break; + case 6: + { _localctx = new VariableExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 158; + State = 163; Match(ID); } break; - case 5: + case 7: { _localctx = new CallExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 159; + State = 164; Match(ID); - State = 160; + State = 165; Match(T__1); - State = 169; + State = 174; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399443021828L) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6755399449247748L) != 0)) { { - State = 161; + State = 166; ((CallExpressionContext)_localctx)._expression = expression(0); ((CallExpressionContext)_localctx)._params.Add(((CallExpressionContext)_localctx)._expression); - State = 166; + State = 171; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==T__2) { { { - State = 162; + State = 167; Match(T__2); - State = 163; + State = 168; ((CallExpressionContext)_localctx)._expression = expression(0); ((CallExpressionContext)_localctx)._params.Add(((CallExpressionContext)_localctx)._expression); } } - State = 168; + State = 173; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } } } - State = 171; + State = 176; Match(T__3); } break; - case 6: + case 8: { _localctx = new NotExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 172; - Match(T__16); - State = 173; + State = 177; + Match(T__18); + State = 178; expression(35); } break; - case 7: + case 9: { _localctx = new InvertExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 174; - Match(T__17); - State = 175; + State = 179; + Match(T__19); + State = 180; expression(34); } break; - case 8: + case 10: { _localctx = new IncrementPrefixExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 176; - Match(T__18); - State = 177; + State = 181; + Match(T__20); + State = 182; target(); } break; - case 9: + case 11: { _localctx = new DecrementPrefixExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 178; - Match(T__19); - State = 179; + State = 183; + Match(T__21); + State = 184; target(); } break; - case 10: + case 12: { _localctx = new IncrementPostfixExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 180; + State = 185; target(); - State = 181; - Match(T__18); + State = 186; + Match(T__20); } break; - case 11: + case 13: { _localctx = new DecrementPostfixExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 183; + State = 188; target(); - State = 184; - Match(T__19); + State = 189; + Match(T__21); } break; - case 12: + case 14: { _localctx = new CompoundMultiplyExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 186; + State = 191; target(); - State = 187; + State = 192; Match(T__38); - State = 188; + State = 193; expression(11); } break; - case 13: + case 15: { _localctx = new CompoundDivideExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 190; + State = 195; target(); - State = 191; + State = 196; Match(T__39); - State = 192; + State = 197; expression(10); } break; - case 14: + case 16: { _localctx = new CompoundModulusExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 194; + State = 199; target(); - State = 195; + State = 200; Match(T__40); - State = 196; + State = 201; expression(9); } break; - case 15: + case 17: { _localctx = new CompoundAddExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 198; + State = 203; target(); - State = 199; + State = 204; Match(T__41); - State = 200; + State = 205; expression(8); } break; - case 16: + case 18: { _localctx = new CompoundSubtractExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 202; + State = 207; target(); - State = 203; + State = 208; Match(T__42); - State = 204; + State = 209; expression(7); } break; - case 17: + case 19: { _localctx = new CompoundBitwiseAndExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 206; + State = 211; target(); - State = 207; + State = 212; Match(T__43); - State = 208; + State = 213; expression(6); } break; - case 18: + case 20: { _localctx = new CompoundBitwiseOrExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 210; + State = 215; target(); - State = 211; + State = 216; Match(T__44); - State = 212; + State = 217; expression(5); } break; - case 19: + case 21: { _localctx = new CompoundBitwiseXorExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 214; + State = 219; target(); - State = 215; + State = 220; Match(T__45); - State = 216; + State = 221; expression(4); } break; - case 20: + case 22: { _localctx = new CompoundBitwiseLeftShiftExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 218; + State = 223; target(); - State = 219; + State = 224; Match(T__46); - State = 220; + State = 225; expression(3); } break; - case 21: + case 23: { _localctx = new CompoundBitwiseRightShiftExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 222; + State = 227; target(); - State = 223; + State = 228; Match(T__47); - State = 224; + State = 229; expression(2); } break; } Context.Stop = TokenStream.LT(-1); - State = 290; + State = 295; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,20,Context); while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) { @@ -1877,7 +1928,7 @@ public partial class CGrammarParser : Parser { TriggerExitRuleEvent(); _prevctx = _localctx; { - State = 288; + State = 293; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,19,Context) ) { case 1: @@ -1885,11 +1936,11 @@ public partial class CGrammarParser : Parser { _localctx = new MultiplyExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((MultiplyExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 228; + State = 233; if (!(Precpred(Context, 29))) throw new FailedPredicateException(this, "Precpred(Context, 29)"); - State = 229; - Match(T__20); - State = 230; + State = 234; + Match(T__15); + State = 235; ((MultiplyExpressionContext)_localctx).right = expression(30); } break; @@ -1898,11 +1949,11 @@ public partial class CGrammarParser : Parser { _localctx = new DivideExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((DivideExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 231; + State = 236; if (!(Precpred(Context, 28))) throw new FailedPredicateException(this, "Precpred(Context, 28)"); - State = 232; - Match(T__21); - State = 233; + State = 237; + Match(T__22); + State = 238; ((DivideExpressionContext)_localctx).right = expression(29); } break; @@ -1911,11 +1962,11 @@ public partial class CGrammarParser : Parser { _localctx = new ModulusExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((ModulusExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 234; + State = 239; if (!(Precpred(Context, 27))) throw new FailedPredicateException(this, "Precpred(Context, 27)"); - State = 235; - Match(T__22); - State = 236; + State = 240; + Match(T__23); + State = 241; ((ModulusExpressionContext)_localctx).right = expression(28); } break; @@ -1924,11 +1975,11 @@ public partial class CGrammarParser : Parser { _localctx = new AddExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((AddExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 237; + State = 242; if (!(Precpred(Context, 26))) throw new FailedPredicateException(this, "Precpred(Context, 26)"); - State = 238; - Match(T__23); - State = 239; + State = 243; + Match(T__24); + State = 244; ((AddExpressionContext)_localctx).right = expression(27); } break; @@ -1937,11 +1988,11 @@ public partial class CGrammarParser : Parser { _localctx = new SubtractExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((SubtractExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 240; + State = 245; if (!(Precpred(Context, 25))) throw new FailedPredicateException(this, "Precpred(Context, 25)"); - State = 241; - Match(T__24); - State = 242; + State = 246; + Match(T__25); + State = 247; ((SubtractExpressionContext)_localctx).right = expression(26); } break; @@ -1950,11 +2001,11 @@ public partial class CGrammarParser : Parser { _localctx = new LessThanExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((LessThanExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 243; + State = 248; if (!(Precpred(Context, 24))) throw new FailedPredicateException(this, "Precpred(Context, 24)"); - State = 244; - Match(T__25); - State = 245; + State = 249; + Match(T__26); + State = 250; ((LessThanExpressionContext)_localctx).right = expression(25); } break; @@ -1963,11 +2014,11 @@ public partial class CGrammarParser : Parser { _localctx = new GreaterThanExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((GreaterThanExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 246; + State = 251; if (!(Precpred(Context, 23))) throw new FailedPredicateException(this, "Precpred(Context, 23)"); - State = 247; - Match(T__26); - State = 248; + State = 252; + Match(T__27); + State = 253; ((GreaterThanExpressionContext)_localctx).right = expression(24); } break; @@ -1976,11 +2027,11 @@ public partial class CGrammarParser : Parser { _localctx = new LessThanOrEqualExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((LessThanOrEqualExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 249; + State = 254; if (!(Precpred(Context, 22))) throw new FailedPredicateException(this, "Precpred(Context, 22)"); - State = 250; - Match(T__27); - State = 251; + State = 255; + Match(T__28); + State = 256; ((LessThanOrEqualExpressionContext)_localctx).right = expression(23); } break; @@ -1989,11 +2040,11 @@ public partial class CGrammarParser : Parser { _localctx = new GreaterThanOrEqualExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((GreaterThanOrEqualExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 252; + State = 257; if (!(Precpred(Context, 21))) throw new FailedPredicateException(this, "Precpred(Context, 21)"); - State = 253; - Match(T__28); - State = 254; + State = 258; + Match(T__29); + State = 259; ((GreaterThanOrEqualExpressionContext)_localctx).right = expression(22); } break; @@ -2002,11 +2053,11 @@ public partial class CGrammarParser : Parser { _localctx = new EqualExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((EqualExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 255; + State = 260; if (!(Precpred(Context, 20))) throw new FailedPredicateException(this, "Precpred(Context, 20)"); - State = 256; - Match(T__29); - State = 257; + State = 261; + Match(T__30); + State = 262; ((EqualExpressionContext)_localctx).right = expression(21); } break; @@ -2015,11 +2066,11 @@ public partial class CGrammarParser : Parser { _localctx = new NotEqualExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((NotEqualExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 258; + State = 263; if (!(Precpred(Context, 19))) throw new FailedPredicateException(this, "Precpred(Context, 19)"); - State = 259; - Match(T__30); - State = 260; + State = 264; + Match(T__31); + State = 265; ((NotEqualExpressionContext)_localctx).right = expression(20); } break; @@ -2028,11 +2079,11 @@ public partial class CGrammarParser : Parser { _localctx = new BitwiseAndExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((BitwiseAndExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 261; + State = 266; if (!(Precpred(Context, 18))) throw new FailedPredicateException(this, "Precpred(Context, 18)"); - State = 262; - Match(T__31); - State = 263; + State = 267; + Match(T__17); + State = 268; ((BitwiseAndExpressionContext)_localctx).right = expression(19); } break; @@ -2041,11 +2092,11 @@ public partial class CGrammarParser : Parser { _localctx = new BitwiseOrExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((BitwiseOrExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 264; + State = 269; if (!(Precpred(Context, 17))) throw new FailedPredicateException(this, "Precpred(Context, 17)"); - State = 265; + State = 270; Match(T__32); - State = 266; + State = 271; ((BitwiseOrExpressionContext)_localctx).right = expression(18); } break; @@ -2054,11 +2105,11 @@ public partial class CGrammarParser : Parser { _localctx = new BitwiseXorExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((BitwiseXorExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 267; + State = 272; if (!(Precpred(Context, 16))) throw new FailedPredicateException(this, "Precpred(Context, 16)"); - State = 268; + State = 273; Match(T__33); - State = 269; + State = 274; ((BitwiseXorExpressionContext)_localctx).right = expression(17); } break; @@ -2067,11 +2118,11 @@ public partial class CGrammarParser : Parser { _localctx = new BitwiseLeftShiftExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((BitwiseLeftShiftExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 270; + State = 275; if (!(Precpred(Context, 15))) throw new FailedPredicateException(this, "Precpred(Context, 15)"); - State = 271; + State = 276; Match(T__34); - State = 272; + State = 277; ((BitwiseLeftShiftExpressionContext)_localctx).right = expression(16); } break; @@ -2080,11 +2131,11 @@ public partial class CGrammarParser : Parser { _localctx = new BitwiseRightShiftExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((BitwiseRightShiftExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 273; + State = 278; if (!(Precpred(Context, 14))) throw new FailedPredicateException(this, "Precpred(Context, 14)"); - State = 274; + State = 279; Match(T__35); - State = 275; + State = 280; ((BitwiseRightShiftExpressionContext)_localctx).right = expression(15); } break; @@ -2093,11 +2144,11 @@ public partial class CGrammarParser : Parser { _localctx = new LogicalAndExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((LogicalAndExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 276; + State = 281; if (!(Precpred(Context, 13))) throw new FailedPredicateException(this, "Precpred(Context, 13)"); - State = 277; + State = 282; Match(T__36); - State = 278; + State = 283; ((LogicalAndExpressionContext)_localctx).right = expression(14); } break; @@ -2106,11 +2157,11 @@ public partial class CGrammarParser : Parser { _localctx = new LogicalOrExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((LogicalOrExpressionContext)_localctx).left = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 279; + State = 284; if (!(Precpred(Context, 12))) throw new FailedPredicateException(this, "Precpred(Context, 12)"); - State = 280; + State = 285; Match(T__37); - State = 281; + State = 286; ((LogicalOrExpressionContext)_localctx).right = expression(13); } break; @@ -2119,22 +2170,22 @@ public partial class CGrammarParser : Parser { _localctx = new TernaryExpressionContext(new ExpressionContext(_parentctx, _parentState)); ((TernaryExpressionContext)_localctx).cond = _prevctx; PushNewRecursionContext(_localctx, _startState, RULE_expression); - State = 282; + State = 287; if (!(Precpred(Context, 1))) throw new FailedPredicateException(this, "Precpred(Context, 1)"); - State = 283; + State = 288; Match(T__48); - State = 284; + State = 289; ((TernaryExpressionContext)_localctx).then = expression(0); - State = 285; + State = 290; Match(T__49); - State = 286; + State = 291; ((TernaryExpressionContext)_localctx).@else = expression(2); } break; } } } - State = 292; + State = 297; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,20,Context); } @@ -2182,7 +2233,7 @@ public partial class CGrammarParser : Parser { _localctx = new IntConstantContext(_localctx); EnterOuterAlt(_localctx, 1); { - State = 293; + State = 298; Match(INT); } } @@ -2228,7 +2279,7 @@ public partial class CGrammarParser : Parser { _localctx = new VariableTargetContext(_localctx); EnterOuterAlt(_localctx, 1); { - State = 295; + State = 300; Match(ID); } } @@ -2275,7 +2326,7 @@ public partial class CGrammarParser : Parser { } private static int[] _serializedATN = { - 4,1,54,298,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7, + 4,1,54,303,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7, 7,7,2,8,7,8,1,0,4,0,20,8,0,11,0,12,0,21,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,5,1,34,8,1,10,1,12,1,37,9,1,3,1,39,8,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,5,1,51,8,1,10,1,12,1,54,9,1,3,1,56,8,1,1,1,1,1,3,1,60, @@ -2284,97 +2335,99 @@ public partial class CGrammarParser : Parser { 8,4,1,4,1,4,3,4,95,8,4,1,4,1,4,3,4,99,8,4,1,4,1,4,1,4,1,4,1,4,1,4,3,4, 107,8,4,1,4,1,4,3,4,111,8,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1, 4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,3,4,139, - 8,4,1,5,1,5,1,5,1,5,3,5,145,8,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1, - 6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,5,6,165,8,6,10,6,12,6,168,9,6,3,6,170, - 8,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1, + 8,4,1,5,1,5,1,5,1,5,1,5,3,5,146,8,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1, + 6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,5,6,170,8,6,10,6, + 12,6,173,9,6,3,6,175,8,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1, 6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6, 1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1, - 6,1,6,1,6,1,6,3,6,227,8,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6, + 6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,3,6,232,8,6,1,6,1,6,1,6,1,6,1,6,1,6, 1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1, 6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6, - 1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,5,6,289,8,6,10, - 6,12,6,292,9,6,1,7,1,7,1,8,1,8,1,8,0,1,12,9,0,2,4,6,8,10,12,14,16,0,0, - 354,0,19,1,0,0,0,2,59,1,0,0,0,4,61,1,0,0,0,6,72,1,0,0,0,8,138,1,0,0,0, - 10,140,1,0,0,0,12,226,1,0,0,0,14,293,1,0,0,0,16,295,1,0,0,0,18,20,3,2, - 1,0,19,18,1,0,0,0,20,21,1,0,0,0,21,19,1,0,0,0,21,22,1,0,0,0,22,23,1,0, - 0,0,23,24,5,0,0,1,24,1,1,0,0,0,25,26,5,1,0,0,26,27,5,51,0,0,27,38,5,2, - 0,0,28,29,5,1,0,0,29,35,5,51,0,0,30,31,5,3,0,0,31,32,5,1,0,0,32,34,5,51, - 0,0,33,30,1,0,0,0,34,37,1,0,0,0,35,33,1,0,0,0,35,36,1,0,0,0,36,39,1,0, - 0,0,37,35,1,0,0,0,38,28,1,0,0,0,38,39,1,0,0,0,39,40,1,0,0,0,40,41,5,4, - 0,0,41,60,5,5,0,0,42,43,5,1,0,0,43,44,5,51,0,0,44,55,5,2,0,0,45,46,5,1, - 0,0,46,52,5,51,0,0,47,48,5,3,0,0,48,49,5,1,0,0,49,51,5,51,0,0,50,47,1, - 0,0,0,51,54,1,0,0,0,52,50,1,0,0,0,52,53,1,0,0,0,53,56,1,0,0,0,54,52,1, - 0,0,0,55,45,1,0,0,0,55,56,1,0,0,0,56,57,1,0,0,0,57,58,5,4,0,0,58,60,3, - 4,2,0,59,25,1,0,0,0,59,42,1,0,0,0,60,3,1,0,0,0,61,65,5,6,0,0,62,64,3,6, - 3,0,63,62,1,0,0,0,64,67,1,0,0,0,65,63,1,0,0,0,65,66,1,0,0,0,66,68,1,0, - 0,0,67,65,1,0,0,0,68,69,5,7,0,0,69,5,1,0,0,0,70,73,3,8,4,0,71,73,3,10, - 5,0,72,70,1,0,0,0,72,71,1,0,0,0,73,7,1,0,0,0,74,75,5,8,0,0,75,76,3,12, - 6,0,76,77,5,5,0,0,77,139,1,0,0,0,78,79,5,9,0,0,79,80,5,2,0,0,80,81,3,12, - 6,0,81,82,5,4,0,0,82,85,3,8,4,0,83,84,5,10,0,0,84,86,3,8,4,0,85,83,1,0, - 0,0,85,86,1,0,0,0,86,139,1,0,0,0,87,88,5,11,0,0,88,90,5,2,0,0,89,91,3, - 12,6,0,90,89,1,0,0,0,90,91,1,0,0,0,91,92,1,0,0,0,92,94,5,5,0,0,93,95,3, - 12,6,0,94,93,1,0,0,0,94,95,1,0,0,0,95,96,1,0,0,0,96,98,5,5,0,0,97,99,3, - 12,6,0,98,97,1,0,0,0,98,99,1,0,0,0,99,100,1,0,0,0,100,101,5,4,0,0,101, - 139,3,8,4,0,102,103,5,11,0,0,103,104,5,2,0,0,104,106,3,10,5,0,105,107, - 3,12,6,0,106,105,1,0,0,0,106,107,1,0,0,0,107,108,1,0,0,0,108,110,5,5,0, - 0,109,111,3,12,6,0,110,109,1,0,0,0,110,111,1,0,0,0,111,112,1,0,0,0,112, - 113,5,4,0,0,113,114,3,8,4,0,114,139,1,0,0,0,115,116,5,12,0,0,116,117,5, - 2,0,0,117,118,3,12,6,0,118,119,5,4,0,0,119,120,3,8,4,0,120,139,1,0,0,0, - 121,122,5,13,0,0,122,123,3,8,4,0,123,124,5,12,0,0,124,125,5,2,0,0,125, - 126,3,12,6,0,126,127,5,4,0,0,127,128,5,5,0,0,128,139,1,0,0,0,129,130,5, - 14,0,0,130,139,5,5,0,0,131,132,5,15,0,0,132,139,5,5,0,0,133,134,3,12,6, - 0,134,135,5,5,0,0,135,139,1,0,0,0,136,139,3,4,2,0,137,139,5,5,0,0,138, - 74,1,0,0,0,138,78,1,0,0,0,138,87,1,0,0,0,138,102,1,0,0,0,138,115,1,0,0, - 0,138,121,1,0,0,0,138,129,1,0,0,0,138,131,1,0,0,0,138,133,1,0,0,0,138, - 136,1,0,0,0,138,137,1,0,0,0,139,9,1,0,0,0,140,141,5,1,0,0,141,144,5,51, - 0,0,142,143,5,16,0,0,143,145,3,12,6,0,144,142,1,0,0,0,144,145,1,0,0,0, - 145,146,1,0,0,0,146,147,5,5,0,0,147,11,1,0,0,0,148,149,6,6,-1,0,149,150, - 5,2,0,0,150,151,3,12,6,0,151,152,5,4,0,0,152,227,1,0,0,0,153,227,3,14, - 7,0,154,155,3,16,8,0,155,156,5,16,0,0,156,157,3,12,6,38,157,227,1,0,0, - 0,158,227,5,51,0,0,159,160,5,51,0,0,160,169,5,2,0,0,161,166,3,12,6,0,162, - 163,5,3,0,0,163,165,3,12,6,0,164,162,1,0,0,0,165,168,1,0,0,0,166,164,1, - 0,0,0,166,167,1,0,0,0,167,170,1,0,0,0,168,166,1,0,0,0,169,161,1,0,0,0, - 169,170,1,0,0,0,170,171,1,0,0,0,171,227,5,4,0,0,172,173,5,17,0,0,173,227, - 3,12,6,35,174,175,5,18,0,0,175,227,3,12,6,34,176,177,5,19,0,0,177,227, - 3,16,8,0,178,179,5,20,0,0,179,227,3,16,8,0,180,181,3,16,8,0,181,182,5, - 19,0,0,182,227,1,0,0,0,183,184,3,16,8,0,184,185,5,20,0,0,185,227,1,0,0, - 0,186,187,3,16,8,0,187,188,5,39,0,0,188,189,3,12,6,11,189,227,1,0,0,0, - 190,191,3,16,8,0,191,192,5,40,0,0,192,193,3,12,6,10,193,227,1,0,0,0,194, - 195,3,16,8,0,195,196,5,41,0,0,196,197,3,12,6,9,197,227,1,0,0,0,198,199, - 3,16,8,0,199,200,5,42,0,0,200,201,3,12,6,8,201,227,1,0,0,0,202,203,3,16, - 8,0,203,204,5,43,0,0,204,205,3,12,6,7,205,227,1,0,0,0,206,207,3,16,8,0, - 207,208,5,44,0,0,208,209,3,12,6,6,209,227,1,0,0,0,210,211,3,16,8,0,211, - 212,5,45,0,0,212,213,3,12,6,5,213,227,1,0,0,0,214,215,3,16,8,0,215,216, - 5,46,0,0,216,217,3,12,6,4,217,227,1,0,0,0,218,219,3,16,8,0,219,220,5,47, - 0,0,220,221,3,12,6,3,221,227,1,0,0,0,222,223,3,16,8,0,223,224,5,48,0,0, - 224,225,3,12,6,2,225,227,1,0,0,0,226,148,1,0,0,0,226,153,1,0,0,0,226,154, - 1,0,0,0,226,158,1,0,0,0,226,159,1,0,0,0,226,172,1,0,0,0,226,174,1,0,0, - 0,226,176,1,0,0,0,226,178,1,0,0,0,226,180,1,0,0,0,226,183,1,0,0,0,226, - 186,1,0,0,0,226,190,1,0,0,0,226,194,1,0,0,0,226,198,1,0,0,0,226,202,1, - 0,0,0,226,206,1,0,0,0,226,210,1,0,0,0,226,214,1,0,0,0,226,218,1,0,0,0, - 226,222,1,0,0,0,227,290,1,0,0,0,228,229,10,29,0,0,229,230,5,21,0,0,230, - 289,3,12,6,30,231,232,10,28,0,0,232,233,5,22,0,0,233,289,3,12,6,29,234, - 235,10,27,0,0,235,236,5,23,0,0,236,289,3,12,6,28,237,238,10,26,0,0,238, - 239,5,24,0,0,239,289,3,12,6,27,240,241,10,25,0,0,241,242,5,25,0,0,242, - 289,3,12,6,26,243,244,10,24,0,0,244,245,5,26,0,0,245,289,3,12,6,25,246, - 247,10,23,0,0,247,248,5,27,0,0,248,289,3,12,6,24,249,250,10,22,0,0,250, - 251,5,28,0,0,251,289,3,12,6,23,252,253,10,21,0,0,253,254,5,29,0,0,254, - 289,3,12,6,22,255,256,10,20,0,0,256,257,5,30,0,0,257,289,3,12,6,21,258, - 259,10,19,0,0,259,260,5,31,0,0,260,289,3,12,6,20,261,262,10,18,0,0,262, - 263,5,32,0,0,263,289,3,12,6,19,264,265,10,17,0,0,265,266,5,33,0,0,266, - 289,3,12,6,18,267,268,10,16,0,0,268,269,5,34,0,0,269,289,3,12,6,17,270, - 271,10,15,0,0,271,272,5,35,0,0,272,289,3,12,6,16,273,274,10,14,0,0,274, - 275,5,36,0,0,275,289,3,12,6,15,276,277,10,13,0,0,277,278,5,37,0,0,278, - 289,3,12,6,14,279,280,10,12,0,0,280,281,5,38,0,0,281,289,3,12,6,13,282, - 283,10,1,0,0,283,284,5,49,0,0,284,285,3,12,6,0,285,286,5,50,0,0,286,287, - 3,12,6,2,287,289,1,0,0,0,288,228,1,0,0,0,288,231,1,0,0,0,288,234,1,0,0, - 0,288,237,1,0,0,0,288,240,1,0,0,0,288,243,1,0,0,0,288,246,1,0,0,0,288, - 249,1,0,0,0,288,252,1,0,0,0,288,255,1,0,0,0,288,258,1,0,0,0,288,261,1, - 0,0,0,288,264,1,0,0,0,288,267,1,0,0,0,288,270,1,0,0,0,288,273,1,0,0,0, - 288,276,1,0,0,0,288,279,1,0,0,0,288,282,1,0,0,0,289,292,1,0,0,0,290,288, - 1,0,0,0,290,291,1,0,0,0,291,13,1,0,0,0,292,290,1,0,0,0,293,294,5,52,0, - 0,294,15,1,0,0,0,295,296,5,51,0,0,296,17,1,0,0,0,21,21,35,38,52,55,59, - 65,72,85,90,94,98,106,110,138,144,166,169,226,288,290 + 1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1, + 6,1,6,5,6,294,8,6,10,6,12,6,297,9,6,1,7,1,7,1,8,1,8,1,8,0,1,12,9,0,2,4, + 6,8,10,12,14,16,0,0,361,0,19,1,0,0,0,2,59,1,0,0,0,4,61,1,0,0,0,6,72,1, + 0,0,0,8,138,1,0,0,0,10,140,1,0,0,0,12,231,1,0,0,0,14,298,1,0,0,0,16,300, + 1,0,0,0,18,20,3,2,1,0,19,18,1,0,0,0,20,21,1,0,0,0,21,19,1,0,0,0,21,22, + 1,0,0,0,22,23,1,0,0,0,23,24,5,0,0,1,24,1,1,0,0,0,25,26,5,1,0,0,26,27,5, + 51,0,0,27,38,5,2,0,0,28,29,5,1,0,0,29,35,5,51,0,0,30,31,5,3,0,0,31,32, + 5,1,0,0,32,34,5,51,0,0,33,30,1,0,0,0,34,37,1,0,0,0,35,33,1,0,0,0,35,36, + 1,0,0,0,36,39,1,0,0,0,37,35,1,0,0,0,38,28,1,0,0,0,38,39,1,0,0,0,39,40, + 1,0,0,0,40,41,5,4,0,0,41,60,5,5,0,0,42,43,5,1,0,0,43,44,5,51,0,0,44,55, + 5,2,0,0,45,46,5,1,0,0,46,52,5,51,0,0,47,48,5,3,0,0,48,49,5,1,0,0,49,51, + 5,51,0,0,50,47,1,0,0,0,51,54,1,0,0,0,52,50,1,0,0,0,52,53,1,0,0,0,53,56, + 1,0,0,0,54,52,1,0,0,0,55,45,1,0,0,0,55,56,1,0,0,0,56,57,1,0,0,0,57,58, + 5,4,0,0,58,60,3,4,2,0,59,25,1,0,0,0,59,42,1,0,0,0,60,3,1,0,0,0,61,65,5, + 6,0,0,62,64,3,6,3,0,63,62,1,0,0,0,64,67,1,0,0,0,65,63,1,0,0,0,65,66,1, + 0,0,0,66,68,1,0,0,0,67,65,1,0,0,0,68,69,5,7,0,0,69,5,1,0,0,0,70,73,3,8, + 4,0,71,73,3,10,5,0,72,70,1,0,0,0,72,71,1,0,0,0,73,7,1,0,0,0,74,75,5,8, + 0,0,75,76,3,12,6,0,76,77,5,5,0,0,77,139,1,0,0,0,78,79,5,9,0,0,79,80,5, + 2,0,0,80,81,3,12,6,0,81,82,5,4,0,0,82,85,3,8,4,0,83,84,5,10,0,0,84,86, + 3,8,4,0,85,83,1,0,0,0,85,86,1,0,0,0,86,139,1,0,0,0,87,88,5,11,0,0,88,90, + 5,2,0,0,89,91,3,12,6,0,90,89,1,0,0,0,90,91,1,0,0,0,91,92,1,0,0,0,92,94, + 5,5,0,0,93,95,3,12,6,0,94,93,1,0,0,0,94,95,1,0,0,0,95,96,1,0,0,0,96,98, + 5,5,0,0,97,99,3,12,6,0,98,97,1,0,0,0,98,99,1,0,0,0,99,100,1,0,0,0,100, + 101,5,4,0,0,101,139,3,8,4,0,102,103,5,11,0,0,103,104,5,2,0,0,104,106,3, + 10,5,0,105,107,3,12,6,0,106,105,1,0,0,0,106,107,1,0,0,0,107,108,1,0,0, + 0,108,110,5,5,0,0,109,111,3,12,6,0,110,109,1,0,0,0,110,111,1,0,0,0,111, + 112,1,0,0,0,112,113,5,4,0,0,113,114,3,8,4,0,114,139,1,0,0,0,115,116,5, + 12,0,0,116,117,5,2,0,0,117,118,3,12,6,0,118,119,5,4,0,0,119,120,3,8,4, + 0,120,139,1,0,0,0,121,122,5,13,0,0,122,123,3,8,4,0,123,124,5,12,0,0,124, + 125,5,2,0,0,125,126,3,12,6,0,126,127,5,4,0,0,127,128,5,5,0,0,128,139,1, + 0,0,0,129,130,5,14,0,0,130,139,5,5,0,0,131,132,5,15,0,0,132,139,5,5,0, + 0,133,134,3,12,6,0,134,135,5,5,0,0,135,139,1,0,0,0,136,139,3,4,2,0,137, + 139,5,5,0,0,138,74,1,0,0,0,138,78,1,0,0,0,138,87,1,0,0,0,138,102,1,0,0, + 0,138,115,1,0,0,0,138,121,1,0,0,0,138,129,1,0,0,0,138,131,1,0,0,0,138, + 133,1,0,0,0,138,136,1,0,0,0,138,137,1,0,0,0,139,9,1,0,0,0,140,141,5,1, + 0,0,141,142,5,16,0,0,142,145,5,51,0,0,143,144,5,17,0,0,144,146,3,12,6, + 0,145,143,1,0,0,0,145,146,1,0,0,0,146,147,1,0,0,0,147,148,5,5,0,0,148, + 11,1,0,0,0,149,150,6,6,-1,0,150,151,5,2,0,0,151,152,3,12,6,0,152,153,5, + 4,0,0,153,232,1,0,0,0,154,232,3,14,7,0,155,156,3,16,8,0,156,157,5,17,0, + 0,157,158,3,12,6,40,158,232,1,0,0,0,159,160,5,16,0,0,160,232,3,12,6,39, + 161,162,5,18,0,0,162,232,3,16,8,0,163,232,5,51,0,0,164,165,5,51,0,0,165, + 174,5,2,0,0,166,171,3,12,6,0,167,168,5,3,0,0,168,170,3,12,6,0,169,167, + 1,0,0,0,170,173,1,0,0,0,171,169,1,0,0,0,171,172,1,0,0,0,172,175,1,0,0, + 0,173,171,1,0,0,0,174,166,1,0,0,0,174,175,1,0,0,0,175,176,1,0,0,0,176, + 232,5,4,0,0,177,178,5,19,0,0,178,232,3,12,6,35,179,180,5,20,0,0,180,232, + 3,12,6,34,181,182,5,21,0,0,182,232,3,16,8,0,183,184,5,22,0,0,184,232,3, + 16,8,0,185,186,3,16,8,0,186,187,5,21,0,0,187,232,1,0,0,0,188,189,3,16, + 8,0,189,190,5,22,0,0,190,232,1,0,0,0,191,192,3,16,8,0,192,193,5,39,0,0, + 193,194,3,12,6,11,194,232,1,0,0,0,195,196,3,16,8,0,196,197,5,40,0,0,197, + 198,3,12,6,10,198,232,1,0,0,0,199,200,3,16,8,0,200,201,5,41,0,0,201,202, + 3,12,6,9,202,232,1,0,0,0,203,204,3,16,8,0,204,205,5,42,0,0,205,206,3,12, + 6,8,206,232,1,0,0,0,207,208,3,16,8,0,208,209,5,43,0,0,209,210,3,12,6,7, + 210,232,1,0,0,0,211,212,3,16,8,0,212,213,5,44,0,0,213,214,3,12,6,6,214, + 232,1,0,0,0,215,216,3,16,8,0,216,217,5,45,0,0,217,218,3,12,6,5,218,232, + 1,0,0,0,219,220,3,16,8,0,220,221,5,46,0,0,221,222,3,12,6,4,222,232,1,0, + 0,0,223,224,3,16,8,0,224,225,5,47,0,0,225,226,3,12,6,3,226,232,1,0,0,0, + 227,228,3,16,8,0,228,229,5,48,0,0,229,230,3,12,6,2,230,232,1,0,0,0,231, + 149,1,0,0,0,231,154,1,0,0,0,231,155,1,0,0,0,231,159,1,0,0,0,231,161,1, + 0,0,0,231,163,1,0,0,0,231,164,1,0,0,0,231,177,1,0,0,0,231,179,1,0,0,0, + 231,181,1,0,0,0,231,183,1,0,0,0,231,185,1,0,0,0,231,188,1,0,0,0,231,191, + 1,0,0,0,231,195,1,0,0,0,231,199,1,0,0,0,231,203,1,0,0,0,231,207,1,0,0, + 0,231,211,1,0,0,0,231,215,1,0,0,0,231,219,1,0,0,0,231,223,1,0,0,0,231, + 227,1,0,0,0,232,295,1,0,0,0,233,234,10,29,0,0,234,235,5,16,0,0,235,294, + 3,12,6,30,236,237,10,28,0,0,237,238,5,23,0,0,238,294,3,12,6,29,239,240, + 10,27,0,0,240,241,5,24,0,0,241,294,3,12,6,28,242,243,10,26,0,0,243,244, + 5,25,0,0,244,294,3,12,6,27,245,246,10,25,0,0,246,247,5,26,0,0,247,294, + 3,12,6,26,248,249,10,24,0,0,249,250,5,27,0,0,250,294,3,12,6,25,251,252, + 10,23,0,0,252,253,5,28,0,0,253,294,3,12,6,24,254,255,10,22,0,0,255,256, + 5,29,0,0,256,294,3,12,6,23,257,258,10,21,0,0,258,259,5,30,0,0,259,294, + 3,12,6,22,260,261,10,20,0,0,261,262,5,31,0,0,262,294,3,12,6,21,263,264, + 10,19,0,0,264,265,5,32,0,0,265,294,3,12,6,20,266,267,10,18,0,0,267,268, + 5,18,0,0,268,294,3,12,6,19,269,270,10,17,0,0,270,271,5,33,0,0,271,294, + 3,12,6,18,272,273,10,16,0,0,273,274,5,34,0,0,274,294,3,12,6,17,275,276, + 10,15,0,0,276,277,5,35,0,0,277,294,3,12,6,16,278,279,10,14,0,0,279,280, + 5,36,0,0,280,294,3,12,6,15,281,282,10,13,0,0,282,283,5,37,0,0,283,294, + 3,12,6,14,284,285,10,12,0,0,285,286,5,38,0,0,286,294,3,12,6,13,287,288, + 10,1,0,0,288,289,5,49,0,0,289,290,3,12,6,0,290,291,5,50,0,0,291,292,3, + 12,6,2,292,294,1,0,0,0,293,233,1,0,0,0,293,236,1,0,0,0,293,239,1,0,0,0, + 293,242,1,0,0,0,293,245,1,0,0,0,293,248,1,0,0,0,293,251,1,0,0,0,293,254, + 1,0,0,0,293,257,1,0,0,0,293,260,1,0,0,0,293,263,1,0,0,0,293,266,1,0,0, + 0,293,269,1,0,0,0,293,272,1,0,0,0,293,275,1,0,0,0,293,278,1,0,0,0,293, + 281,1,0,0,0,293,284,1,0,0,0,293,287,1,0,0,0,294,297,1,0,0,0,295,293,1, + 0,0,0,295,296,1,0,0,0,296,13,1,0,0,0,297,295,1,0,0,0,298,299,5,52,0,0, + 299,15,1,0,0,0,300,301,5,51,0,0,301,17,1,0,0,0,21,21,35,38,52,55,59,65, + 72,85,90,94,98,106,110,138,145,171,174,231,293,295 }; public static readonly ATN _ATN = diff --git a/Compiler/gen/CGrammarVisitor.cs b/Compiler/gen/CGrammarVisitor.cs index a3271f8..0c4e8ae 100644 --- a/Compiler/gen/CGrammarVisitor.cs +++ b/Compiler/gen/CGrammarVisitor.cs @@ -148,6 +148,13 @@ public interface ICGrammarVisitor<Result> : IParseTreeVisitor<Result> { /// <return>The visitor result.</return> Result VisitVariableDeclaration([NotNull] CGrammarParser.VariableDeclarationContext context); /// <summary> + /// Visit a parse tree produced by the <c>addressOfExpression</c> + /// labeled alternative in <see cref="CGrammarParser.expression"/>. + /// </summary> + /// <param name="context">The parse tree.</param> + /// <return>The visitor result.</return> + Result VisitAddressOfExpression([NotNull] CGrammarParser.AddressOfExpressionContext context); + /// <summary> /// Visit a parse tree produced by the <c>compoundSubtractExpression</c> /// labeled alternative in <see cref="CGrammarParser.expression"/>. /// </summary> @@ -274,6 +281,13 @@ public interface ICGrammarVisitor<Result> : IParseTreeVisitor<Result> { /// <return>The visitor result.</return> Result VisitInvertExpression([NotNull] CGrammarParser.InvertExpressionContext context); /// <summary> + /// Visit a parse tree produced by the <c>dereferenceExpression</c> + /// labeled alternative in <see cref="CGrammarParser.expression"/>. + /// </summary> + /// <param name="context">The parse tree.</param> + /// <return>The visitor result.</return> + Result VisitDereferenceExpression([NotNull] CGrammarParser.DereferenceExpressionContext context); + /// <summary> /// Visit a parse tree produced by the <c>equalExpression</c> /// labeled alternative in <see cref="CGrammarParser.expression"/>. /// </summary> diff --git a/Emulator/Program.cs b/Emulator/Program.cs index c5ae852..675b8d6 100644 --- a/Emulator/Program.cs +++ b/Emulator/Program.cs @@ -59,7 +59,6 @@ internal class Program // Thread.Sleep(1); // cpu.Clock(); - Thread.Sleep(1000); } Console.WriteLine($"Exit code: 0x{cpu.V[0]:X4}"); }); diff --git a/ROMs/hello_c.asm b/ROMs/hello_c.asm index 761f32b..bdb32ff 100644 --- a/ROMs/hello_c.asm +++ b/ROMs/hello_c.asm @@ -1,24 +1,21 @@ jmp _main -_add_int_a__int_b: ; int add(int a, int b) - pop V0 ; Pop return address to register, to preserve during parameter access - pop [$51FF] ; param int a - pop [$5201] ; param int b - push V0 ; Restore function return address - push [$51FF] ; left operand - mov [$5201], V1 ; right operand - pop V0 ; get left operand back - add V0, V1 ; compute addition - mov AX, V0 ; return value - ret - mov 0, V0 ; fallback return 0 - ret - _main: ; int main() - push 2 ; arg int a - push 1 ; arg int b - call _add_int_a__int_b ; int add(int a, int b) - mov V0, V0 ; return value - ret + mov 1, [$51FF] ; int x = 1 + mov 0, [$5201] ; int i = 0 +_body_1: + push [$5201] ; left operand + mov 10, V1 ; right operand + pop V0 ; get left operand back + lt V0, V1 ; compute less than check + not LX + bz + jmp _end_2 ; if for condition fails, jump to end + mult [$51FF], 2 ; compute multiplication + mov AX, [$51FF] ; store back into left param + push [$5201] ; i++ + inc [$5201] + pop V0 +_end_2: mov 0, V0 ; fallback return 0 ret diff --git a/ROMs/hello_c.c b/ROMs/hello_c.c index 839c12d..f670952 100644 --- a/ROMs/hello_c.c +++ b/ROMs/hello_c.c @@ -1,9 +1,7 @@ -int add(int a, int b) -{ - return a + b; -} - int main() { - return add(1, 2); + int x = 1; + for (int i = 0; i < 10; i++) { + x *= 2; + } }
\ No newline at end of file diff --git a/ROMs/hello_c.q1 b/ROMs/hello_c.q1 Binary files differindex ae6e4bb..1af8388 100644 --- a/ROMs/hello_c.q1 +++ b/ROMs/hello_c.q1 |
