private IList <SyntaxNode> GetSyntaxNode(IList <Token> tokens, ref int index) { var nodes = new List <SyntaxNode>(); int count = tokens.Count; while (index < count) { Token token = tokens[index]; SyntaxNode node = null; switch (token.Type) { case TokenType.DOSNUD: index++; node = GetCompareNode(tokens, ref index); if (node is null) { index--; } node = new DosnudNode { Expression = node as ExpressionNode, }; break; case TokenType.ANAX: index++; node = GetAnaxNode(tokens, ref index); break; case TokenType.FI: case TokenType.FAL: node = GetControlNode(tokens, ref index); break; case TokenType.RINYV: case TokenType.SITUV: return(nodes); default: node = GetEksaNode(tokens, ref index); break; } if (node != null) { nodes.Add(node); } ; } return(nodes); }
protected override void ToDosnud(DosnudNode node, IDictionary <IdentifierNode, uint> anaxDictionary) { if (node.Expression != null) { OutputExpression(node.Expression, "f0", anaxDictionary); } this.writer.WriteLine("krz f3 f5 ; restore stack poiter"); this.writer.WriteLine("krz f5@ f3 ata 4 f5"); this.writer.WriteLine("krz f5@ xx ; dosnud"); }
protected abstract void ToDosnud(DosnudNode node, IDictionary <IdentifierNode, uint> anaxDictionary);