physical-computation / sunflower-embedded-system-emulator

Sunflower Full-System Hardware Emulator and Physical System Simulator for Sensor-Driven Systems. Built-in architecture modeling of Hitachi SH (j-core), RISC-V, and more.
http://sflr.org
BSD 3-Clause "New" or "Revised" License
24 stars 215 forks source link

Remove lex file duplication #127

Open SamuelmsWong-zz opened 5 years ago

SamuelmsWong-zz commented 5 years ago

lex-hitachi-sh.c and lex-riscv.c differ only in the tokens for their assembly instructions, so the rest (tokens for Sunflower commands and the lexical analyser function) is all duplicated.

phillipstanleymarbell commented 4 years ago

One approach would be to split off the common %token T_* at the start of the .ys into a sf-common-tokens.y and to similarly split off the common grammar rules into a sf-common-grammar.y. @SamuelmsWong @rjlv2 @jan-heck : if any of you are interested...

SamuelmsWong-zz commented 4 years ago

Hi. I can probably get started on this in a few weeks.

phillipstanleymarbell commented 4 years ago

That's great!