Development:New parser's architecture

From Tom

Jump to: navigation, search

Warning: Work In Progress

Dev : Developping

Writing JUnit tests  > Writing an Ant task  > Creating a new plugin  > Messages and exceptions : Using the logger  > PIL language  > Description of ADT  > Description of external libraries  > New parser's architecture

Contents

Architecture

Overview

HostParser : main loop

Stream Analysis

StreamAnalyst class and its subclasses are intended to detect keywords, "delimited sequences" and "negative imbrication level" in source code. All those classes are in tom.engine.newparser.streamanalysis package.

Inheritance scheme goes like :

StreamAnalyst
  ├─ KeywordDetector
  │    ├─ EOLDetector
  │    └─ EOFDetector
  ├─ DelimitedSequenceDetector
  └─ NegativeImbricationDetector

EOLDetector and EOFDetector are just convenience classes for really common keywords.

Using stream analysts

 

Detecting Keywords

A "delimited sequence" is everything starting with a keyword and ending with an other one.

ParserAction

Grammar

Recursivity

Extending

Creating appropriate grammar rule

Implementing a ParserAction class for that rule

Calling that ParserAction from main loop

Recursivity

Developping

Writing JUnit tests  > Writing an Ant task  > Creating a new plugin  > Messages and exceptions : Using the logger  > PIL language  > Description of ADT  > Description of external libraries  > New parser's architecture

Development corner
Developping Tom Compiler :: Creating a Tom release
Personal tools
Create a book