-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from nrubin29/new_eval
Rewrote evaluation code to be more object-oriented.
- Loading branch information
Showing
7 changed files
with
500 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
1. The input is processed into a series of tokens using regular expressions. | ||
* Calculator#_tokenize | ||
2. The tokens are turned into a tree of RuleMatches using a right-recursive pattern matching algorithm. | ||
* Calculator#_match | ||
3. The tree is fixed. Unnecessary tokens are removed, precedence issues are fixed, etc. | ||
* Ast#_fixed | ||
4. The tree is evaluated in a recursive fashion. | ||
* Ast#evaluate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.