|
-
Mar 31st, 2003, 07:04 AM
#1
Thread Starter
transcendental analytic
Left recursion
How do you deal with left recursion of for instance expressions such as
a-b-c
this shows how to eliminate left recursion
http://courses.essex.ac.uk/lg/LG511/.../index_11.html
by making it right recursive. but then a-(b-c) would be a misinterpretation. same would (a^b)^c be of a^b^c
I can't even write a simple math expression parser 
T->T
T->T + F
T->T - F
F->P
F->F * P
F->F / P
P->I
P->I ^ P
I->( T )
I->i
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|