Goldie: Parse Anything

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) -> GoldieLib Sample Apps -> Parse Anything

# Parse Anything

Parses any source file according to any compiled grammar and displays basic information about both the language and the parsed source.

Try using the included lang/calc.cgt language on the included *.calc files. Or use your own grammar and source.

Parse Anything Source Code

### Sample run:

>cat lang/valid_sample2.calc 4*4*3 /4 - ( 10 + 0 ) * -100 >goldie-parseAnything lang/valid_sample2.calc lang/calc.cgt Grammar Info: File: lang/calc.cgt Name: Calc Version: 0.01 Author: Nick Sabalausky About: Basic Calculator Grammar Root of parse tree: type: NonTerminal name: <Add Exp> First terminal in parse tree: type: Terminal name: Number content: '4' line: 1 Last terminal in parse tree: type: Terminal name: Number content: '100' line: 4 Root of parse tree has 3 child node(s): Node index 0 is a NonTerminal '<Add Exp>' with 1 child node(s) and content '4*4*3/4' and raw content: 4*4*3 /4 Node index 1 is a Terminal '-' Node index 2 is a NonTerminal '<Mult Exp>' with 3 child node(s) and content '(10+0)*-100' and raw content: ( 10 + 0 ) * -100