You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for sharing this work! I would like to parse dollar values in my expression, for example:
$1,500.75 - $200.00
I'm not sure the best way to do this, but it looks like I can create a custom Lexer and add a token definition with an custom pattern that will match dollar values.
However, I would still need to parse the token into a float. For TokenType::RealNumber this happens in the Node::factory method which is called from the private function shuntingYard in the the Parser class. This doesn't look easily extendable.
Do you have any suggestions on how I should go about this?
The text was updated successfully, but these errors were encountered:
Thanks for sharing this work! I would like to parse dollar values in my expression, for example:
I'm not sure the best way to do this, but it looks like I can create a custom Lexer and add a token definition with an custom pattern that will match dollar values.
However, I would still need to parse the token into a float. For
TokenType::RealNumber
this happens in theNode::factory
method which is called from the private functionshuntingYard
in the the Parser class. This doesn't look easily extendable.Do you have any suggestions on how I should go about this?
The text was updated successfully, but these errors were encountered: