Goldie: Sample Generic Parse

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

- Requirements
- Download / Install
- Never Used a Parsing Tool?
- Goldie Overview
- Beginner's Tutorial
- Grammar Definition Language
- Contact / Support
  - Message Board
  - Issue Tracking

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 Static
- Calculator Dynamic
- Sample Generic Parse

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

- Scripts for Developers
- Library Source and StaticLang

Goldie Home (v0.8) -> GoldieLib Sample Apps -> Sample Generic Parse

# Sample Generic Parse

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.

Sample Generic Parse Source Code

### Sample run:

>cat lang/valid_sample2.calc 4*4*3 /4 - ( 10 + 0 ) * -100 >goldie-sampleGenericParse 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