Search found 20 matches: math expression parser
Searched query: +math +expression +parser
- Fri Dec 27, 2024 11:59 am
- Forum: Tricks 'n' Tips
- Topic: Math function graph
- Replies: 27
- Views: 16213
Re: Math function graph
Please feel free to use this math parser in your code. It handles all basic math expressions correctly, including those mentioned above by Stargate.
Thanks John, this could be a big help.
As soon I've more time I will look into it in detail. I am not sure how to continue with the program, maybe it ...
- Mon Dec 23, 2024 5:39 pm
- Forum: Tricks 'n' Tips
- Topic: Math function graph
- Replies: 27
- Views: 16213
Math function graph
I needed a program to show some math functions, so I wrote a small program doing so.
Grabbed some ... EvalOptimizer= 1
Global EvalExpression.s
Global EvalStep.i
Global EvalToken.s ... X
EvalVarVal(0) = xval
;entry point into parser
EvalStep = 1
EvalError = #EvalNoError ...
Grabbed some ... EvalOptimizer= 1
Global EvalExpression.s
Global EvalStep.i
Global EvalToken.s ... X
EvalVarVal(0) = xval
;entry point into parser
EvalStep = 1
EvalError = #EvalNoError ...
- Mon Dec 04, 2023 2:59 am
- Forum: Coding Questions
- Topic: help TinyBASIC implementation (translated from izibasic spaghetti)
- Replies: 3
- Views: 779
help TinyBASIC implementation (translated from izibasic spaghetti)
... 1.2"}
{RESOURCEFILE "tinyBasic.rsrc"}
{PARSER ON}
{SECUREFILES OFF}
' A temp
' B temp
' C ... K temp
' L number of lines
' N number
' S expression stack index
' T temp
' V variable index
' A ... 27-52] = 26 variables
' [53-82] = 30 items math stack
CONST I$="BYE, CLEAR, CLS, END"
CONST J ...
{RESOURCEFILE "tinyBasic.rsrc"}
{PARSER ON}
{SECUREFILES OFF}
' A temp
' B temp
' C ... K temp
' L number of lines
' N number
' S expression stack index
' T temp
' V variable index
' A ... 27-52] = 26 variables
' [53-82] = 30 items math stack
CONST I$="BYE, CLEAR, CLS, END"
CONST J ...
- Sun Oct 16, 2022 7:42 pm
- Forum: Coding Questions
- Topic: Input numbers and add them up:
- Replies: 21
- Views: 2176
- Fri Sep 25, 2015 10:37 pm
- Forum: Feature Requests and Wishlists
- Topic: operator ^ for power
- Replies: 40
- Views: 12090
Re: operator ^ for power
I think that math rules have been "bowed" by programmers of math parser. :D
Sadly enough, this is very true :x
Only someone who doesn't have sufficient knowledge in this field can write something like ... what the "common" interpretation of this expression is?
Did you perform a survey in a ...
Sadly enough, this is very true :x
Only someone who doesn't have sufficient knowledge in this field can write something like ... what the "common" interpretation of this expression is?
Did you perform a survey in a ...
- Fri Sep 25, 2015 8:13 am
- Forum: Feature Requests and Wishlists
- Topic: operator ^ for power
- Replies: 40
- Views: 12090
Re: operator ^ for power
I think that math rules have been "bowed" by programmers of math parser. :D
Sadly enough, this is very true :x
Only someone who doesn't have sufficient knowledge in this field can write something like ... what the "common" interpretation of this expression is?
Did you perform a survey in a ...
Sadly enough, this is very true :x
Only someone who doesn't have sufficient knowledge in this field can write something like ... what the "common" interpretation of this expression is?
Did you perform a survey in a ...
- Wed Apr 22, 2015 10:37 pm
- Forum: Tricks 'n' Tips
- Topic: Evaluate and process math expressions
- Replies: 23
- Views: 22959
Re: Evaluate and process math expressions
... thread are written in a way, so that the scanner (tokenizer) and the parser are independent from each other. So the used scanner can be easily replaced with another one.
For those who like Regular Expressions , here is a scanner that is based on them.
For using it, in the code in the first or ...
For those who like Regular Expressions , here is a scanner that is based on them.
For using it, in the code in the first or ...
- Wed Apr 22, 2015 10:36 pm
- Forum: Tricks 'n' Tips
- Topic: Evaluate and process math expressions
- Replies: 23
- Views: 22959
Re: Evaluate and process math expressions
... the previous one.
It's purpose is to convert a mathematical expression, so that it's compatible with PB syntax.
There was a discussion that showed need for code like this.
//edit 2015-04-26:
New ... changes.
; -- Special recursive descent parser for mathematical expressions:
; For making ...
It's purpose is to convert a mathematical expression, so that it's compatible with PB syntax.
There was a discussion that showed need for code like this.
//edit 2015-04-26:
New ... changes.
; -- Special recursive descent parser for mathematical expressions:
; For making ...
- Wed Apr 22, 2015 10:30 pm
- Forum: Tricks 'n' Tips
- Topic: Evaluate and process math expressions
- Replies: 23
- Views: 22959
Evaluate and process math expressions
Hi,
this is just one more recursive descent parser. :-)
In contrast to the code in the following post, this one evaluates mathematical expressions.
For more details see comments in the code.
//edit 2015-04-23:
Yesterday I had forgotten to translate some error messages into English. Now fixed ...
this is just one more recursive descent parser. :-)
In contrast to the code in the following post, this one evaluates mathematical expressions.
For more details see comments in the code.
//edit 2015-04-23:
Yesterday I had forgotten to translate some error messages into English. Now fixed ...
- Sun Apr 19, 2015 11:16 am
- Forum: Coding Questions
- Topic: Pow '^' operator
- Replies: 30
- Views: 9197
Re: Pow '^' operator
... team. However, you could look into creating a math parser and evaluator, which would take an entire expression, parse and calculate it, and return the results. The syntax would look something like this: y = math("(0.4^2-(0.6-(x^2+y^2)^0.5)^2)^0.5") ;assuming the variables are globals There are quite a ...
- Tue Feb 07, 2012 12:04 am
- Forum: General Discussion
- Topic: At future with PureBasic ?
- Replies: 36
- Views: 12229
Re: At future with PureBasic ?
... all IsXxx() and XxxID() functions to the expression parser (for data breakpoints)
8th September 2010 : Version 4.51
- Fixed: Quite some compiler and libraries related bugs
7th June 2010 : Version ... CloseCryptRandom()
- Added: Many math functions: Exp(), ATan2(), Radian(), Degree ...
8th September 2010 : Version 4.51
- Fixed: Quite some compiler and libraries related bugs
7th June 2010 : Version ... CloseCryptRandom()
- Added: Many math functions: Exp(), ATan2(), Radian(), Degree ...
- Fri Dec 23, 2011 1:58 pm
- Forum: Coding Questions
- Topic: looking for simple exp parser
- Replies: 4
- Views: 1442
Re: looking for simple exp parser
Hey folks,
Ive seen a simple expression parser before some time and was not able to find it again :(
So if anyone knows a parser for simple math expressions (at least +-*/) with the possibility to add own functions (like mySin() ) on the fly, I would be glad if you could tell me!
I think you mean ...
Ive seen a simple expression parser before some time and was not able to find it again :(
So if anyone knows a parser for simple math expressions (at least +-*/) with the possibility to add own functions (like mySin() ) on the fly, I would be glad if you could tell me!
I think you mean ...
- Fri Dec 23, 2011 1:40 pm
- Forum: Coding Questions
- Topic: looking for simple exp parser
- Replies: 4
- Views: 1442
looking for simple exp parser
Hey folks,
Ive seen a simple expression parser before some time and was not able to find it again
So if anyone knows a parser for simple math expressions (at least +-*/) with the possibility to add own functions (like mySin() ) on the fly, I would be glad if you could tell me!
Ive seen a simple expression parser before some time and was not able to find it again

So if anyone knows a parser for simple math expressions (at least +-*/) with the possibility to add own functions (like mySin() ) on the fly, I would be glad if you could tell me!
- Mon Aug 08, 2011 9:12 pm
- Forum: Game Programming
- Topic: Text RPG Design Thread [1 new, on: Screenshot, working cmd]
- Replies: 82
- Views: 62439
Re: Text RPG Design Thread [1 new on, Threading/Logic Loop]
... Like using the execution time of a simple math expression, or getting a directory listing, or something mundane like that.
How complex does an RNG really need to get to be fair, but difficult to ... on to the game to be parsed by a command parser, like a MUD would parse commands from a logged ...
How complex does an RNG really need to get to be fair, but difficult to ... on to the game to be parsed by a command parser, like a MUD would parse commands from a logged ...
- Thu Mar 18, 2010 8:12 pm
- Forum: Off Topic
- Topic: Arithmetic questions
- Replies: 10
- Views: 1532
Re: Arithmetic questions
All math books I read in the fractional part of the last hundred years had identical rules: a unary ... 1" independendly what comes behind...
If a parser is not able to decode such things, it won't work either for the "-1" nor the "-2" in the "-1^-2" expression (the program Eigenmath is an example for ...
If a parser is not able to decode such things, it won't work either for the "-1" nor the "-2" in the "-1^-2" expression (the program Eigenmath is an example for ...