Sunday, December 11, 2011

How to write a scanner for a compiler in VB.NET?

As a part of school project I need to write a scanner and a parser for a compiler, I've chosen to do so using VB.NET. How do I write a language definition part of the scanner?How to write a scanner for a compiler in VB.NET?
Using VB.Net there might be classes which are already defined to do such, use regular expressions to parse your syntax. Your scanner will need to tokenize the text for use by the parser. So in doing such you will need to use regular expressions heavily. Do some research on regular expressions.



If you used a language like C you could use flex/yacc, bison etc. These tools help in development of languages.

No comments:

Post a Comment