Hi all,I have edited this post. As I received some personal comments, I temporarily hide this code. If you have any difficulties in implementing a java parser for mathematics expression, please email me, I will help you!
This is my first try in Parser. Hope this can help you guys !
The parser_main will take the input expression and parse this one, and finally, return the value of the expression.
This is the first time I tried to code a parser. If there are bugs, please comment. I always appreciate that. ^^
[Java] Math Parser
Đăng ký:
Đăng Nhận xét (Atom)
can you explain more about this code ? I'm newbie in java
Trả lờiXóathis code is used for parsing mathematical expressions and return the value.
Trả lờiXóaThe input is a CharSequence type. The parser_main gets that input and do parsing. If there is any error in parsing, this code will throw an exception. That means we call ParseError() and print out the error. For more details, contact me via email.
ur code has bug in factorial function. anw, i like this code. thank you !
Trả lờiXóaIt's hard to see your code in blogspot without any "TAB". Does it allow to embed code in entry? Just some comments! :)
Trả lờiXóa@Unknown: Oh thnks a lot. I'll fix this bug later.
Trả lờiXóa@tnbk: Blogspot allows to display embbed code using HTML template. But I still don't want to use it. Maybe you will find difficulty reading code on blog entries... Well that's my point too. I want people who read my codes have some difficulties :)) Have fun !