[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

parser, python og bnf



Hejsa

Jeg har et sprog, abc (anvendt til tekstuel definition af musik notation), som jeg gerne vil kunne parse "rigtigt". Hidtil har jeg arbejdet hovedsageligt med regulære udtryk, men det kan være vanskeligt at holde tungen lige i munden og tage højde for alle særlige tilfælde og koden er ikke særlig sjov at vedligeholde eller udvide.

Derfor tænker jeg at vejen frem kunne være at parse sproget rigtigt. Jeg husker meget lidt fra mit syntaks/semantik kursus på universitet, men har fundet en bnf definition af sproget her:

http://www.norbeck.nu/abc/bnf/abc20bnf.htm

Hvordan griber jeg det an i python, hvorledes skal jeg levere bnf definitionen og hvor i python angriber jeg bedst opgaven?

NB: Jeg har googlet lidt på det og fundet et par links, men jeg har måske brug for liiige at komme igang:

http://eikke.com/pyparsing-introduction-bnf-to-code/
http://pyparsing.wikispaces.com/message/view/home/348167

NB2: Det ser ud til at pyparsing ikke er inkluderet i python. Jeg ville jo allerhelst anvende noget som altid virker og som tillader at jeg shipper mit script som én fil. Findes der andre muligheder der er lisså gode men som er inkluderet i python?

--
Atte


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2008-10-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *