0

I need some help with CS task. I have to make a grammar (for LL() top-down parser) that will take math equation with all operators (+-/*^ and relation) without using left recursion and "erese production" (by this, I think he means epsilon). After hours of trying to find some help searching the web I cant come up with any solution to this problem. Can you help me?

Dave
  • 1
  • 1
  • Welcome to Stack Overflow! Please [edit] your question to show [what you have tried so far](http://whathaveyoutried.com). You should include a [mcve] of the code that you are having problems with, then we can try to help with the specific problem. You should also read [ask]. – Toby Speight Jan 31 '17 at 17:31
  • Did you look at any grammars of existing programming languages, e.g. [C](https://www.lysator.liu.se/c/ANSI-C-grammar-y.html#assignment-expression). I know this is for YACC, but it should give you a starting point. Just keep removing what you don't need then take a look at what is left. – Guy Coder Jan 31 '17 at 17:38
  • @GuyCoder: OP would probably be better off looking at ANTLR3 grammars, since they must avoid left-recursion (although I'm pretty sure they can use ε productions). However, the best source is more likely the lecture notes and/or textbook for the course OP is taking. – rici Jan 31 '17 at 19:41
  • Unfortunetly notes and textbook contain only basic mathematical linguistic knowladge (this is basic cs course that has topics from compuctional complexity to logic gates and fuzzy logic, just only scracthing the surface of each one). It just happens that lecturer is a **** and wants to **** with me. – Dave Jan 31 '17 at 20:23

0 Answers0