summaryrefslogtreecommitdiff
path: root/src/genbind-parser.y
blob: 42330f79b4b0faec630d5061bc6fe263d5dc2cc7 (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
59
60
/*
 * 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
%define api.prefix "genbind_"
%name-prefix "genbind_"

%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);
        }
        ;

%%