feed

NOTE: This is an excerpt from the in-code documentation of the parser.  I thought I’d post it as an introduction on how error recovery works in RCC.  I’ll add examples later. Error recovery in rcc involves trying to alter the token stream in order to produce a valid parse.  This is predicated on the idea that [...]

read on →

I’m going to take the opportunity to elaborate on something I mentioned in Introduction to RCC Grammars): RCC-generated lexers are context-sensitive. Specifically, RCC generates a whole set of lexers for you, one for each parser state. Why should you care?  Well, because it means that RCC can handle declaratively what you might have had to do with [...]

read on →

When building an RCC grammar, you will be focussing on two primary things: describing lexical elements (keywords, operators, names, etc.) describing grammatical structures (rules about how lexical elements combine to create meaning) In addition to these basic elements, RCC also needs you to describe the Abstract Syntax Tree that will be built when a source file is processed [...]

read on →

I don’t have time to post a full article tonight, but I’d like to get something up for you all to look at.  So here is a sample RCC grammar file to look at.  It is, in fact, the RCC description of its own grammar language.  I’ll break it down in an article tomorrow. [UPDATE]: I’ve [...]

read on →

The first thing you should know about the RCC grammar description language is that action code is not embedded in the grammar.  This differs greatly from systems like yacc and ANTLR, which essentially overlay a macro layer on a source file in the output language.  I’m pretty big on separation of concerns — I think [...]

read on →

I know that at least a few of you are probably asking that question.  And I guess it’s a fair question — programming languages take a certain level of skill to design, and a certain level of expertise to implement.  Truth be told, there seems to be a common perception that language designers rate up [...]

read on →


Site copyright 2007-2008 Chris Poirier.       Powered by Wordpress.       Entries RSS Comments RSS Validate Log in