* [libre-riscv-dev] GardenSnake.py
@ 2020-03-29 10:40 Luke Kenneth Casson Leighton
2020-03-29 11:35 ` Luke Kenneth Casson Leighton
0 siblings, 1 reply; 2+ messages in thread
From: Luke Kenneth Casson Leighton @ 2020-03-29 10:40 UTC (permalink / raw)
To: Libre-RISCV General Development
i love python-ply. i love that it does embedded BNF in
comment-strings, and a lot more.
GardenSnake.py was an example of a python code-parser written *in*
python to parse a very small subset *of* python, using python-ply.
the problem is: ply is designed as a LALR parser (and yacc lexer),
where python is a *whitespace* language that completely fails to fit
standard LALR.
it therefore needed a special parser, which worked for a short
duration of time until some internal changes in ply caused it to
break. i spent this morning getting it working, and the example
succeeds! w00t!
however that's not why i'm writing (although it's cool) - it's because
these files:
https://libre-riscv.org/openpower/isa/stringldst/
all need a *whitespace* (indentation) parser in order to be able to read them.
ah.
the actual "language" is even more basic than python, however if we're
to accelerate things - and stand a chance of getting them right
without laborious checking - we need to be able to parse these
pseudo-code fragments and get them into python (and later nmigen).
so i am currently attempting to add "else" support to GardenSnake.py,
then "while", and after that it should be pretty straightforward to
convert to the power pseudo-code.
l.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [libre-riscv-dev] GardenSnake.py
2020-03-29 10:40 [libre-riscv-dev] GardenSnake.py Luke Kenneth Casson Leighton
@ 2020-03-29 11:35 ` Luke Kenneth Casson Leighton
0 siblings, 0 replies; 2+ messages in thread
From: Luke Kenneth Casson Leighton @ 2020-03-29 11:35 UTC (permalink / raw)
To: Libre-RISCV General Development
https://git.libre-riscv.org/?p=soc.git;a=commitdiff;h=990d2e93d339d9138a7f6a96910e2ed89ed960c8
eeeee! while loops! eeeeee!
:)
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, back to index
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-29 10:40 [libre-riscv-dev] GardenSnake.py Luke Kenneth Casson Leighton
2020-03-29 11:35 ` Luke Kenneth Casson Leighton
Libre RISC-V Mailing list Archives (accessible via public-inbox)
Archives are clonable: git clone --mirror https://inbox.libre-soc.org/libre-riscv-dev
Example config snippet for mirrors
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git