hpi-swa-teaching / AcceptIt

SWT 2018 Group 12
MIT License
3 stars 3 forks source link

Refactor parsing/compiling methods #68

Open Askir opened 6 years ago

Askir commented 6 years ago

You can find this:

evaluator := self grammar synthesizedAttribute: self semantic new.
match := self grammar match: aString startingFrom: self startRule.    

everywhere spread throughout the parser and compiler classes. It can easily be encapsuled into a method and will make the code much more readable.

Todo:

  1. Write a test for the code snippet above
  2. Copy paste that snippet into a method -> test should be green

For each occurence of those two lines:

  1. Test method that calls these lines
  2. Comment the method to document what it does
  3. Replace with new method
  4. Refactor further if feasible

Repeat untill the snippet only occurs once in the project