Fixed romparser bug, resolved SDOCM00087159
[keystone-rtos/ibl.git] / src / util / romparse / rparse.flex
1 /* Lexical analyzer for the eeprom boot builder */
2 %{
3 #include "rparse.tab.h"
4 extern int line;
5 %}
6 %%
8 "{" return (LBRACE);    
9 "}" return (RBRACE);   
10 "=" return (EQU);           
12 section           { yylval = SECTION;           rBegin(SECTION); return (SECTION);           }
13 layout                    { yylval = LAYOUT;                    rBegin(LAYOUT);  return (LAYOUT);                        }
14 pad                               { yylval = PAD;                               rBegin(PAD);     return (PAD);                           }
15 boot_mode         { yylval = BOOT_MODE;                          return (BOOT_MODE);         }
16 param_index       { yylval = PARAM_INDEX;                        return (PARAM_INDEX);       }
17 options           { yylval = OPTIONS;                            return (OPTIONS);           }
18 multi_i2c_id      { yylval = MULTI_I2C_ID;                       return (MULTI_I2C_ID);      }
19 my_i2c_id         { yylval = MY_I2C_ID;                          return (MY_I2C_ID);         }
20 core_freq_mhz     { yylval = CORE_FREQ_MHZ;                      return (CORE_FREQ_MHZ);     }
21 i2c_clk_freq_khz  { yylval = I2C_CLK_FREQ_KHZ;                   return (I2C_CLK_FREQ_KHZ);  }
22 exe_file          { yylval = EXE_FILE;                           return (EXE_FILE);          }
23 pci_parm                  { yylval = PCI_PARMS;                          return (PCI_PARMS);         }
24 dev_addr_ext      { yylval = DEV_ADDR_EXT;                       return (DEV_ADDR_EXT);          }
25 dev_addr                  { yylval = DEV_ADDR;                                   return (DEV_ADDR);                  }
26 next_dev_addr     { yylval = NEXT_DEV_ADDR;                      return (NEXT_DEV_ADDR);     }
27 next_dev_addr_ext { yylval = NEXT_DEV_ADDR_EXT;                  return (NEXT_DEV_ADDR_EXT); }
28 address_delay     { yylval = ADDRESS_DELAY;                      return (ADDRESS_DELAY);     }
29 sw_pll                    { yylval = SWPLL;                                              return (SWPLL);                         }
30 align                     { yylval = ALIGN;                                                          return (ALIGN);             }
31 len                               { yylval = LENGTH;                                                     return (LENGTH);                        }
32 pad_file_id       { yylval = PAD_FILE_ID;                                                return (PAD_FILE_ID);           }
33 sw_pll_prediv     { yylval = SWPLL_PREDIV;                                               return (SWPLL_PREDIV);      }
34 sw_pll_mult           { yylval = SWPLL_MULT;                                             return (SWPLL_MULT);        }
35 sw_pll_postdiv    { yylval = SWPLL_POSTDIV;                                      return (SWPLL_POSTDIV);     }
36 sw_pll_flags      { yylval = SWPLL_FLAGS;                                                return (SWPLL_FLAGS);       }
37 addr_width        { yylval = ADDR_WIDTH;                                                 return (ADDR_WIDTH);        }
38 n_pins            { yylval = N_PINS;                                                     return (N_PINS);                        }
39 mode              { yylval = MODE;                                                               return (MODE);                          }
40 c2t_delay                 { yylval = C2T_DELAY;                                                  return (C2T_DELAY);             }
41 bus_freq_mhz      { yylval = BUS_FREQ_MHZ;                                           return (BUS_FREQ_MHZ);          }
42 bus_freq_khz      { yylval = BUS_FREQ_KHZ;                                               return (BUS_FREQ_KHZ);          }
43 csel                      { yylval = CSEL;                                                               return (CSEL);                          }
46 [0-9]+           { yylval = atoi(yytext); return (VALUE);  }
47 0x[0-9a-f]+ { sscanf (&yytext[2], "%x", &yylval); return (VALUE);  }
49 \".*\"          return (STRING);
51 ;.*\n       line++ ;
52 [ \t]+          ;
53 [\n]            line++ ;
55 %%