summaryrefslogtreecommitdiff
path: root/src/genbind-parser.y
blob: cad20b46502ad25fa20611218c032b6098c6976a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * This is a bison parser for genbind
 *
 */

%{

#include <stdio.h>
#include <string.h>

#include "genbind-parser.h"
#include "genbind-lexer.h"

  extern int loadwebidl(char *filename);

void genbind_error(const char *str)
{
        fprintf(stderr,"error: %s\n",str);
}


int genbind_wrap()
{
    return 1;
}



%}

%define api.pure

%union
{
  char* text;
}

%token TOK_IDLFILE

%token <text>       TOK_STRING_LITERAL

%%

 /* [1] start with instructions */
Instructions:
        /* empty */
        |
        IdlFile
        ;

IdlFile:
        TOK_IDLFILE TOK_STRING_LITERAL
        {
          loadwebidl($2);
        }
        ;

%%