Anonymous user
Arithmetic Evaluator/Go: Difference between revisions
→Operator precedence parser
(→Library: remove non-working error case) |
imported>Katsumi |
||
Line 3:
This is an operator precedence parser. The number format used in calculation can be changed with the line "type Number int".
<
import (
Line 228:
}
}
</syntaxhighlight>
Example
Line 243:
</pre>
== External links ==
* [
=Library=
Shown here is use of the package go/parser in the standard library. For the Go 1 release, there is a parser in the standard library, but not an evaluator. Evaluation is relatively easy though, once you have a parse tree.
|