Updated: 19990521 1320 PDT

gEDA Symbol Definition Language and Parser

Symbol Definition Language - WORK IN PROGRESS

Language Specification - WORK IN PROGRESS

gsymbol [-cdv] [-i <input file>] [-o <output file>]

Parser - WORK IN PROGRESS

Updated: 19990521 1320 PDT -- 60% complere


Table of Contents

  1. About this Document
    1. Symbol Definition Language 0.1 Specification
    2. Symbol Parser 0.1
    3. Copyright
  2. Description
    1. Symbol Parser
    2. Symbol Description Language
  3. Using the Symbol Description Language and the Symbol Parser
    1. A Simple Example
    2. A More Complex Example
    3. Symbol Parser Syntax
    4. Symbol Parser Defaults
    5. Parser notes.
  4. REFERENCE
    1. Notes.
    2. Strings and Numbers
    3. Symbol Parts
  5. BACKEND SYMBOL GENERATORS
    1. gEDA Backend File Generator
    2. Other Backend File Generators
  6. EXAMPLES OF ALL FUNCTIONALITY XXX fold into reference
    1. The Complete Definition Set
    2. The Minimal Definition Set
  7. ENVIRONMENT
  8. FILES
  9. WORKING EXAMPLES
  10. DIAGNOSTICS
  11. The Code
    1. gsymbol.h
    2. gsymbol_lex.l
    3. gsymbol_parse.y
    4. gsymbol_code.c
    5. Makefile
  12. HISTORY
  13. AUTHORS
  14. BUGS
  15. ToDo

About this Document and the Symbol Parser

Symbol Definition Language 0.1 Specification

Gsymbol Parser 0.1

Copyright

Copyright: See the gEDA Copyright

Table of Contents


DESCRIPTION

Gsymbol
is a parser designed to generate symbols for use in CAD applications, such as gEDA.

The Symbol Desctription Language (SDL)
is a structured language designed to ease the development of symbols for generalized CAD use. SDL is easily extensible and the parser may be fitted to many back-end file genera- tors to fit many CAD applications.

The Symbol Parser

gsymbol is first distributed with a back end to generate gEDA symbol files. Future distributions will include back-ends to generate symbols for other CAD tools, such as chipmunk.

gsymbol converts a Symbol Description Language into the proper form for use by the targeted CAD application.

By default, the gsymbol parser takes its input from stdin and directs output to stdout. This behavior may be modified with command line switches and/or the file statement in the SDL input stream.

XXX What is the precedence for output?

Symbol Description Language.

Symbols for the gEDA suite are in text files which are not easily read- able by humans. Creating symbols was done by editing one of these files, either with gschem or with your favorite editor.

There are problems with this method. The files involved are not easily read and understood. There is no mechanism for using one symbol definition for several symbols.

For example, the 74xx00, 74xx24, 74xx26, 74xx37, 74xx132, etc., all have the same basic shape. If one could draw the basic shape and define symbols that use this shape, the work of creating symbols would be much easier.

Enter SDL , the symbol Definition Language.

Sdl is a context-free grammar, allowing indention, comments, include, and, definition variables. This eases the reading of symbol definition files while retaining the gEDA symbol file format and directory structure.

Creating a symbol is simply an exercise of using your favorite editor, feeding the sdl file to a parser and placing the resultant symbol where gEDA and friends can find it. The parser is case insensitive with respect to keywords.

The sdl files are text files and may be maintained with any of the OS tools available for handling text files.

Table of Contents


USING SDL AND SYMBOL

The basic symbol building block is the symbol or component definition. symbol { symbol definition statements }

So, here is an acceptible definition.


	   symbol {
	     device '12571AX'
	     pin L 1 2	IN   'A'
	     pin L 3 3	IN   'B'
	     pin R 2 1	TRI  'OUT'
	     pin T 0 7	PWR  'VCC'
	     pin B 0 14 POW  'GND'
	   }
If I save this in a file, 12571AX.sdl, and,

Table of Contents


ENVIRONMENT

here are no environment variables used.

Table of Contents


FILES

None.

Table of Contents


EXAMPLES

The following example is a definition for a 74ALS00
      symbol {
        version "19990505"
        file "file1"
        author "Tomdean@ix.speakeasy.org"
        comment 'this is in single quotes'
        comment 'this is a second line of comments in single quotes'
        device '7$00'
        technology 'ALS'
        package "DIP14"
        size 2 3
        parts 4
        pin L 1  1  2  3  4 DOT IN 'IN 1'
        pin R 1  5  6  7  8 DOT OUT 'Out 1'
        pin L 2  9 10 11 12 DOT IN 'IN 2'
        pin R 2 13 14 15 16 DOT OUT 'Out 1'
        pin L 3 17 18 19 20 DOT IN 'IN 3'
        pin R 3 21 22 23 24 DOT OUT 'Out 1'
        LINE    +4.0 +0.0 +0.0 +0.0 7
        LINE    +0.0 +0.0 +0.0 +4.0 7
        LINE    +0.0 +4.0 +4.0 +4.0 7
        ARC     +4.0 +2.0 +0.0 -2.0 +2.0 +0.0  7
        ARC     +4.0 +2.0 +2.0 +0.0 +0.0 +2.0  7
      }

Table of Contents


DIAGNOSTICS

Later.

Table of Contents


The Code

gsymbol.h


Table of Contents


gsymbol_lex.l


Table of Contents


gsymbol_parse.y


Table of Contents


gsymbol_code.c


Table of Contents


Makefile



Table of Contents


HISTORY

This is the first version of symbol Symbol Definition Language, version 0.1, 19990530 Symbol Parser, version 0.1, 19990530

Table of Contents


AUTHORS

The initial version of the SDL and the parser were written by Thomas D. Dean, with much assistance, and help from Ales Hvezda and, Ansel Sermersheim

Table of Contents


BUGS

Many, I am sure.

Table of Contents


ToDo

There are many tasks remaining in both the Symbol Definition Language and the Symbol Parser.
  1. Symbol Definition Language
    1. Collect all the pin definitions into one section
    2. Create examples for several popular chips.
      1. 7400
      2. 74150
      3. 74240
      4. 74573
      5. MC68HC11E0
    3. Verify all the symbol examples actually work
  2. Symbol Parser
    1. Most of the todo items in the Symbol Definition Language are also applicable to the Symbol Parser.
    2. Fix C-style comments
    3. Verify gEDA output forms
  3. Convert libraries to SDL and upload

tomdean@remove.ix.speakeasy.org

Table of Contents