mb/google/octopus: enable xdci controller
[coreboot.git] / util / sconfig / sconfig.l
blob3af70f895132f07cc5ad13c67237e689b8fd363f
1 %{
2 /*
3  * sconfig, coreboot device tree compiler
4  *
5  * Copyright (C) 2010 coresystems GmbH
6  *   written by Patrick Georgi <patrick@georgi-clan.de>
7  *
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.
11  *
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.
16  */
18 #include "sconfig.tab.h"
20 int linenum = 0;
22 %option nodebug
24 [ \t]+          {}
25 #.*\n           {linenum++;}
26 \r?\n           {linenum++;}
27 chip            {return(CHIP);}
28 device          {return(DEVICE);}
29 register        {return(REGISTER);}
30 on              {yylval.number=1; return(BOOL);}
31 off             {yylval.number=0; return(BOOL);}
32 pci             {yylval.number=PCI; return(BUS);}
33 ioapic          {yylval.number=IOAPIC; return(BUS);}
34 pnp             {yylval.number=PNP; return(BUS);}
35 i2c             {yylval.number=I2C; return(BUS);}
36 lapic           {yylval.number=APIC; return(BUS);}
37 cpu_cluster     {yylval.number=CPU_CLUSTER; return(BUS);}
38 cpu             {yylval.number=CPU; return(BUS);}
39 domain          {yylval.number=DOMAIN; return(BUS);}
40 generic         {yylval.number=GENERIC; return(BUS);}
41 mmio            {yylval.number=MMIO; return(BUS);}
42 spi             {yylval.number=SPI; return(BUS);}
43 usb             {yylval.number=USB; return(BUS);}
44 irq             {yylval.number=IRQ; return(RESOURCE);}
45 drq             {yylval.number=DRQ; return(RESOURCE);}
46 io              {yylval.number=IO; return(RESOURCE);}
47 ioapic_irq      {return(IOAPIC_IRQ);}
48 inherit         {return(INHERIT);}
49 subsystemid     {return(SUBSYSTEMID);}
50 end             {return(END);}
51 =               {return(EQUALS);}
52 0x[0-9a-fA-F.]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
53 [0-9.]+         {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
54 [0-9a-fA-F.]+   {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
55 INT[A-D]        {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(PCIINT);}
56 \"\"[^\"]+\"\"  {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
57 \"[^\"]+\"      {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
58 [^ \n\t]+       {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}