Goldie: Library Source and StaticLang

Goldie
Parsing System (v0.4)
Goldie Home (v0.4)
Getting Started

- Requirements
- Download / Install
- Never Used a Parsing Tool?
- How To Use Goldie
- Grammar Definition Language
- Message Board
- Ticket System

Goldie's Tools

- DumpCGT
- GenDocs
  - Template Format
- GRMC: Grammar Compiler
- JsonViewer
  - Parse Tree Mode
- Parse
- StaticLang
- Other Tools

GoldieLib Overview

- Static And Dynamic Styles
- Ambiguous Symbols

GoldieLib Reference

- Base
- Exception
- class Language
- class Lexer
- class Parser
- struct Symbol
- class Token
- Ver

GoldieLib Sample Apps

- Calculator Dynamic
- Calculator Static
- Parse Anything

CGT File Format
FAQ
Change Log
If You Use Trunk
Future Work
Developers

- Library Source and StaticLang

Goldie Home (v0.4) -> Developers -> Library Source and StaticLang

# Library Source and StaticLang

### Q: I've looked at the source for Token, Language, Lexer and Parser, and OMG, what the hell is that mess?! (Especially Token! Geez!)

A: Heh :) Put simply, it's a kludge. The StaticLang tool generates static-style languages directly from Goldie's dynamic-style library source. That mess is all the directives used to help instruct StaticLang in how to do the conversion.

To read the dynamic-style source, just ignore all the weird /+...+/ directives and anything inside version(GoldieStaticLang) (it will NOT be defined when you compile).

To read the static-style source, look at StaticLang's output and remember that version(GoldieStaticLang) WILL be defined when compiling.

To read the dynamic-style source, and see how StaticLang will transform it, see the explanation of StaticLang's preprocessing below.

### Q: Goldie is already a language processing tool. Why don't you just use Goldie and a D grammar to do the conversion?

A: I intend to eventually. But there isn't a D grammar for GOLD just yet (I intend to make one when I get a chance). Also, D is a fairly complex language, and involves a lot of semantic processing (especially if parsed with LR parsing, as GOLD/Goldie does). So GOLD/Goldie will likely need more enhancements before Goldie can support D in a nice clean way. I do intend for Goldie to eventually reach that point, though.

## StaticLang's Preprocessing

Documentation of StaticLang's preprocessing is currently delayed because I may make use of template mixins to take over much of the work currently done by StaticLang.