▼ |  | Parser Tools: lex and yacc-style Parsing

1 | Lexers
2 | LALR(1) Parsers
3 | Context-Free Parsers
4 | Converting yacc or bison Grammars
| Index

On this page:

trans

top ← prev up next →

### 4`` Converting yacc or bison Grammars

(require parser-tools/yacc-to-scheme)

> > procedure

> > (trans file) → any/c

> file : path-string?

Reads a C yacc/bison grammar from file and produces an s-expression that represents a Racket parser for use with parser.

This function is intended to assist in the manual conversion of grammars for use with parser, and not as a fully automatic conversion tool. It is not entirely robust. For example, if the C actions in the original grammar have nested blocks, the tool will fail.

Annotated examples are in the "examples" subdirectory of the "parser-tools" collection.

top ← prev up next →