Expressing the grammar for my lexer
The other day I started blog'ging a series of entries regarding parsing text:
- Building a basic Parser : http://weblogs.asp.net/dneimke/archive/2004/03/24/94832.aspx
- Parsing into Nodes : http://weblogs.asp.net/dneimke/archive/2004/03/24/95046.aspx
I received some feedback from those entries from Scott and Frans correcting me on some erroneous terminology and pointing me to some useful reading material:
I started reading the book yesterday and I've read as far as chapter 3 so far; it's a fascinating book and has already explained so many principles which I never even knew about. For example it lists out the following phases of compilers:
- Lexical analyzer
- Syntax analyzer
- Semantic analyzer
- Intermediate code generator
- Code optimizer
- Code generator
In the next entry relating to "Building a basic Parser" I'm going to focus on a context free grammer called BNF (Backus-Naur Form) which is a notation used to describe the syntax of text and is especially useful when building "lexers". As an aside, when learning about BNF I came across this cool page which outlines the BNF notation for the Visual Basic .NET language:
Visual Basic .NET Grammar Summary