Rechercher une page de manuel

Chercher une autre page de manuel:


Langue: en

Version: 112405 (mandriva - 01/05/08)

Section: 1 (Commandes utilisateur)


monoburg - code generator generator


monoburg [-h] [-e] [-p] [-c VALUE] [-d HEADER] [-DVALUE] [FILE...]


The monoburg program is used to generate tree pattern matchers from BURG specifications. monoburg accepts the following EBNF grammar.
spec: ccode `%%' { dcl } [`%%' ccode] dcl: `%start' nonterm `%term' { identifier [`=' integer] } `%termprefix' { identifier } nonterm `:' tree [cost] [ `{' ccode `}' ] [costfunc] tree: term `(' tree `,' tree `)' term `(' tree `)' term nonterm cost: `"' string '"' integer costfunc: `cost' `{' ccode `}'


Where ccode is arbitrary C code. cost and costfunc are used mutually exclusive, you can't use both in one rule. cost must be a C expression, whereas ccode inside costfunc is the body of a C function. Here are some example rules:

# define some terminal %term Fetch Four Mul Plus # this rule uses fixed costs addr: Plus (con, Mul (Four, reg)) 2 { printf ("Emit your code here."); } # this one computes costs inside a function reg: Fetch (addr) { printf ("Tree address is %p", tree); } cost { int c; c = 1; /* calculate the costs here */ return c; }


A simple pre-processor is included, consisting of: %ifdef, %else and %endif. %ifdef operates on definitions from the command line.


The following options are supported:
Displays usage instructions.
Writes a separate header file which contains all monoburg definitions.
Assume termainals are already defined. Its possible to omit the %term definitions in this mode if you use the %termprefix command. All symbols starting with a prefix specified in %termprefix are considered to be terminals.
Extended mode. Enables monoburg to work with DAGs.
Set the default costs to VALUE
Defines the variable "var" as true. This is used with %ifdef, %else and %endif in the source files to perform conditional compilation.


monoburg was written by Dietmar Maurer. It is based on the papers from Christopher W. Fraser, Robert R. Henry and Todd A. Proebsting: "BURG - Fast Optimal Instruction Selection and Tree Parsing" and "Engineering a Simple, Efficient Code Generator Generator".


monodis(1) pedump(1)
Ceux qui sollicitent, expédient, exécutent ou font
exécuter des ordres arbitraires doivent être punis.
-+- Déclaration des droits de l'homme et du citoyen
(26 août 1789) - Article VII -+-