File: namelist.y

package info (click to toggle)
dynare 4.4.3-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 41,356 kB
  • ctags: 15,842
  • sloc: cpp: 77,029; ansic: 29,056; pascal: 13,241; sh: 4,811; objc: 3,061; yacc: 3,013; makefile: 1,479; lex: 1,258; python: 162; lisp: 54; xml: 8
file content (40 lines) | stat: -rw-r--r-- 683 bytes parent folder | download | duplicates (4)
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
// Copyright (C) 2007-2011, Ondra Kamenik

%{
#include "location.h"
#include "namelist.h"
#include "namelist_tab.hh"

	void namelist_error(const char*);
	int namelist_lex(void);
	extern ogp::NameListParser* name_list_parser;

%}

%union {
	int integer;
	char *string;
	char character;
}

%token COMMA CHARACTER
%token <string> NAME;

%name-prefix="namelist_"

%locations
%error-verbose

%%

namelist : namelist NAME       {name_list_parser->add_name($2);}
         | namelist COMMA NAME {name_list_parser->add_name($3);}
         | NAME                {name_list_parser->add_name($1);}
         ;

%%

void namelist_error(const char* mes)
{
	name_list_parser->namelist_error(mes);
}