Download Here - Js/cc

Transcript
Table of Contents
1.Introducing JS/CC...............................................................................................................3
Welcome to JS/CC!.....................................................................................................................................3
The intention behind JS/CC.........................................................................................................................4
Changes on this documentation..................................................................................................................4
Future plans.................................................................................................................................................4
Some words by the author...........................................................................................................................5
2.A quick start example..........................................................................................................6
Building JS/CC.............................................................................................................................................6
Installation and Start-Up..............................................................................................................................7
An example parser.......................................................................................................................................9
Compiling the example..............................................................................................................................11
3.The Grammar Definition Language..................................................................................12
General......................................................................................................................................................12
The Terminal Declaration Part...................................................................................................................12
Regular Expressions..................................................................................................................................12
Ambiguous Regular Expressions..........................................................................................................13
Associativity and Precedence...............................................................................................................14
Whitespace...........................................................................................................................................14
The Grammar Definition Part.....................................................................................................................15
Accessing right-hand side items in semantic action..............................................................................15
Value types...........................................................................................................................................16
Resolving conflicts................................................................................................................................16
4.Implementing a scripting language...................................................................................18
The idea.....................................................................................................................................................18
Defining the grammar................................................................................................................................19
Executing the script...................................................................................................................................21
The entire source.......................................................................................................................................21
5.Debugging parsers............................................................................................................29
General......................................................................................................................................................29
Debug facilities..........................................................................................................................................30
Debugging with the Web Environment.......................................................................................................31
License Agreements............................................................................................................32
Credits..................................................................................................................................................34
JS/CC User's Manual
Page 2 of 34