Jim's
Tutorials

Fall 2019
course
site

Nick says

This week, I buckled down and wrote a recursive descent parsing class for my language. I am in the process of testing it right now, so I'm not sure exactly what it's weaknesses are yet, if there are any (probably so). I wrote each function individually and then pieced them all together, so I'm unsure if everything is perfectly matched up. The structure mirrors jim's parser, presented on the home page. I still need to add doctests to the file as well, once I figure out what makes the most sense to test...small cases that capture every possible pitfall will take a bit to write for each case, but should be simple in and of themselves.

Output currently when running tweetex.py:

hypatia@Yours-MacBook-Air:https://cs.marlboro.college/cours/fall2019/jims_tutorials/MEGA/plan work/programming_languages$ python3 tweetex.py basictweetex.twx 
Token('None', 'STORY', 'None')
Token('None', 'PREAMBLE', 'None')
Token('None', 'PREAMBLE', 'None')
Token('None', 'MACRO', 'None')
Token('title', 'COMMAND', '\title')
Token('None', 'ARGUMENT', 'None')
Token('My Story', 'CHARACTER', 'My Story')

Something isn't right. Seems preamble is getting called more than once and I'm not sure the list of tokens is actually being exhausted (there should be more here...) but I haven't given it a close look.

https://cs.marlboro.college /cours /fall2019 /jims_tutorials /ncreel /nov19
last modified Sun April 28 2024 11:52 pm

attachments [paper clip]

  last modified size
TXT basictweetex.twx Sun Apr 28 2024 11:52 pm 300B
TXT lexer.py Sun Apr 28 2024 11:52 pm 3.8K
TXT parser.py Sun Apr 28 2024 11:52 pm 6.4K
TXT tweetex.py Sun Apr 28 2024 11:52 pm 1.1K