Leaving Microsoft, Blog Moving to EricWhite.com

Due to personal obligations (moving away from Seattle) it is with sadness that I’m announcing that I’m leaving Microsoft.  My last day at Microsoft will be January 21.  This will be the last post on this blog.  I will be commencing to blog at EricWhite.com/blog.  Here is what I’m planning for the near future on…

8

Building a Simple Recursive Descent Parser (Completed Simple Parser)

In this post, I complete the recursive descent parser that will parse the simple grammar that I presented previously in this series.  In this post, I’ll examine in detail the NospaceExpression class, which needs to implement operator precedence. This blog is inactive.New blog: EricWhite.com/blogBlog TOCNote:  I have to apologize for the delay in writing this…

8

Building a Simple Recursive Descent Parser (continued)

In this post, I further enhance the recursive descent parser that will parse the simple grammar that I presented previously in this series.  I’ll examine some more classes that represent symbols in that grammar.  The classes I present in this post further show how it’s possible to write LINQ code that closely parallels the grammar….

1

Building a Simple Recursive Descent Parser

In this post, I present the start of a recursive descent parser that will parse the simple grammar that I presented previously in this series.  I’ll point out some key features of the code so that it is easy to see how the code works. This blog is inactive.New blog: EricWhite.com/blogBlog TOCThis post is one…

4

Table Markup in Open XML SpreadsheetML

Tables are a feature in Open XML spreadsheets that allow you to interact with data more like a database.  You can select a region and convert it to a table.  Most Excel aficionados are familiar with this feature.  It is very useful. This blog is inactive.New blog: EricWhite.com/blog Blog TOC  In a previous post, Using…

2

Creating a Collection from Singletons and Collections using LINQ

A key operation when doing pure functional transformations is the process of creating complex hierarchies of objects.  We see this when transforming some data source (such as an Open XML WordprocessingML document) to a LINQ to XML tree, and we see this when writing a recursive descent parser.  The recursive descent parser for Excel formulas…

1

Recursive Descent Parser: A Simple Grammar

To learn how recursive descent parsers work, it is helpful to implement a very simple grammar, so for pedagogical purposes, I’ve defined a grammar for simple arithmetic expressions. The parser will construct a syntax tree from expressions that we can then examine as necessary. Just for fun, after implementing the parser, we will write a…

1

Writing a Recursive Descent Parser using C# and LINQ

Recursive descent parsers are one of the easier types of parsers to implement.  Given a properly defined grammar, you write a class for each production in the grammar, and you write one fairly simple method in each class.  Each of those methods returns a ‘production’ based on its source productions (tokens) passed to it.  Once…

1

Hex Dump using LINQ (in 7 Lines of Code)

At one point while debugging the HtmlConverter class, when I found certain situations in the XML, I wanted to dump the XML in binary to see the actual hex values of characters being used.  I got tired of stopping and examining the values in the debugger.  I did a couple of searches, and found some…

10

Ad-Hoc String Concatenation using LINQ

I regularly use functional programming and LINQ in two contexts – when writing code that is part of an example or tool that will potentially execute millions of times, and when writing ad-hoc queries.  These days, I use C# and LINQ as my ‘scripting language’, to iterate through directory structures, open and process Open XML…

6