private ISyntaxTree ParseExpression() { var token = tokens.ConsumeNextType(TokenType.Identifier, TokenType.IntConstant); var tree = new SyntaxTree(token); if (token.Type == TokenType.IntConstant) { return(tree); } if (!tokens.IsNextType(TokenType.OpenParen)) { return(tree); } // has children foreach (var child in ParseChildren()) { tree.AddChild(child); } return(tree); }