3 * sconfig, coreboot device tree compiler
5 * Copyright (C) 2010 coresystems GmbH
6 * written by Patrick Georgi <patrick.georgi@coresystems.de>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
22 #include "sconfig.tab.h"
32 device {return(DEVICE);}
33 register {return(REGISTER);}
34 on {yylval.number=1; return(BOOL);}
35 off {yylval.number=0; return(BOOL);}
36 pci {yylval.number=PCI; return(BUS);}
37 pnp {yylval.number=PNP; return(BUS);}
38 i2c {yylval.number=I2C; return(BUS);}
39 lapic {yylval.number=APIC; return(BUS);}
40 lapic_cluster {yylval.number=APIC_CLUSTER; return(BUS);}
41 pci_domain {yylval.number=PCI_DOMAIN; return(BUS);}
42 irq {yylval.number=IRQ; return(RESOURCE);}
43 drq {yylval.number=DRQ; return(RESOURCE);}
44 io {yylval.number=IO; return(RESOURCE);}
45 inherit {return(INHERIT);}
46 subsystemid {return(SUBSYSTEMID);}
49 0x[0-9a-fA-F.]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
50 [0-9.]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
51 [0-9a-fA-F.]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
52 \"[^\"]+\" {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
53 [^ \n\t]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}