~ubuntu-branches/ubuntu/precise/openarena/precise

« back to all changes in this revision

Viewing changes to code/tools/lcc/lburg/lburg.h

  • Committer: Bazaar Package Importer
  • Author(s): Ansgar Burchardt
  • Date: 2008-09-05 21:14:51 UTC
  • mfrom: (1.2.1 upstream) (2.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080905211451-243bmbl6l6gdav7l
* Remove non-free code/tools/lcc (Closes: #496346)
  + Remove hunk from patch 10_fix_build_and_binary_on_alpha
  + debian/rules: Add BUILD_GAME_QVM=0 to $(MAKE) call
    (thanks to Peter De Wachter)
* Remove code/libs containing binary libraries for Mac OS X and Win32
* debian/copyright: Explain which parts of upstream's sources were removed
* debian/rules: replace ${source:Upstream-Version} by 0.7.7
  because the variable also contains the `+dfsg1' part
* Add -fsigned-char to compiler options (Closes: #487970)
  (thanks to Peter De Wachter)
* Add myself to Uploaders
* debian/control: Remove article from beginning of short description,
  don't start short description with a capital letter
* debian/openarena.6: Escape minus signs
  + fixes lintian warnings: hyphen-used-as-minus-sign

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef BURG_INCLUDED
2
 
#define BURG_INCLUDED
3
 
 
4
 
/* iburg.c: */
5
 
extern void *alloc(int nbytes);
6
 
 
7
 
typedef enum { TERM=1, NONTERM } Kind;
8
 
typedef struct rule *Rule;
9
 
typedef struct term *Term;
10
 
struct term {           /* terminals: */
11
 
        char *name;             /* terminal name */
12
 
        Kind kind;              /* TERM */
13
 
        int esn;                /* external symbol number */
14
 
        int arity;              /* operator arity */
15
 
        Term link;              /* next terminal in esn order */
16
 
        Rule rules;             /* rules whose pattern starts with term */
17
 
};
18
 
 
19
 
typedef struct nonterm *Nonterm;
20
 
struct nonterm {        /* nonterminals: */
21
 
        char *name;             /* nonterminal name */
22
 
        Kind kind;              /* NONTERM */
23
 
        int number;             /* identifying number */
24
 
        int lhscount;           /* # times nt appears in a rule lhs */
25
 
        int reached;            /* 1 iff reached from start nonterminal */
26
 
        Rule rules;             /* rules w/nonterminal on lhs */
27
 
        Rule chain;             /* chain rules w/nonterminal on rhs */
28
 
        Nonterm link;           /* next terminal in number order */
29
 
};
30
 
extern Nonterm nonterm(char *id);
31
 
extern Term term(char *id, int esn);
32
 
 
33
 
typedef struct tree *Tree;
34
 
struct tree {           /* tree patterns: */
35
 
        void *op;               /* a terminal or nonterminal */
36
 
        Tree left, right;       /* operands */
37
 
        int nterms;             /* number of terminal nodes in this tree */
38
 
};
39
 
extern Tree tree(char *op, Tree left, Tree right);
40
 
 
41
 
struct rule {           /* rules: */
42
 
        Nonterm lhs;            /* lefthand side nonterminal */
43
 
        Tree pattern;           /* rule pattern */
44
 
        int ern;                /* external rule number */
45
 
        int packed;             /* packed external rule number */
46
 
        int cost;               /* cost, if a constant */
47
 
        char *code;             /* cost, if an expression */
48
 
        char *template;         /* assembler template */
49
 
        Rule link;              /* next rule in ern order */
50
 
        Rule next;              /* next rule with same pattern root */
51
 
        Rule chain;             /* next chain rule with same rhs */
52
 
        Rule decode;            /* next rule with same lhs */
53
 
        Rule kids;              /* next rule with same _kids pattern */
54
 
};
55
 
extern Rule rule(char *id, Tree pattern, char *template, char *code);
56
 
 
57
 
/* gram.y: */
58
 
void yyerror(char *fmt, ...);
59
 
int yyparse(void);
60
 
void yywarn(char *fmt, ...);
61
 
extern int errcnt;
62
 
extern FILE *infp;
63
 
extern FILE *outfp;
64
 
 
65
 
#endif