Preprocessor assignment

yg01elum
Neuling
Neuling
Beiträge: 4
Registriert: 22. Okt 2012 19:08

Preprocessor assignment

Beitrag von yg01elum »

Hey,
I have problem with the Preprocessor assignment.
I didn't understand the question well.

I created preproc and my tests work fine but i have a problem with the other tests.
Should I create an eval function also in this exercise that uses the new preproc?

Could you please help me?

xarfai
Mausschubser
Mausschubser
Beiträge: 69
Registriert: 14. Okt 2008 00:08

Re: Preprocessor assignment

Beitrag von xarfai »

write down an AST and try to understand which case you forgot.

Hint: The AST should be at least 3-4 levels to see it

f_jakob
Mausschubser
Mausschubser
Beiträge: 50
Registriert: 27. Okt 2009 14:05

Re: Preprocessor assignment

Beitrag von f_jakob »

No, you do not need to write an eval function.

The idea behind the assignment is to enrich the boolean expression language without the need to modify the interpreter. Assume you already have a working interpreter for False, True, Not, And and Or. But now you also want to support implications (Imp) and biimplications (BiImp). The task is to write a preprocessor (preproc), which translates a BE tree having Imp and BiImp nodes to a BE tree which does not contain any Imp or BiImp.

Think about how preproc should translate the different nodes (True, And, Imp, ...) and remember that the tree can be arbitrarily nested.

yg01elum
Neuling
Neuling
Beiträge: 4
Registriert: 22. Okt 2012 19:08

Re: Preprocessor assignment

Beitrag von yg01elum »

Hey guys,
Thanks a lot for your help,
I implented preproc only for BiImpand Imp.
And with your help, I understand I should do the same thing for the others (T, F, ...).
And now it works
Thanks again.

Antworten

Zurück zu „Archiv“