Thanks to visit codestin.com
Credit goes to github.com

Skip to content

zdmwi/smpl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Release Notes

v1.1
This version takes the vanilla implementation using the Visitor design
pattern and creates a generic Repl that can use the command line to
determine which Visitor the user wants to use.
Specific changes:
- Visitor interface now includes a getDefaultState() method

- PersistentWalker class now provides for a visitor that will retain
  the same instance of a state across multiple traversals of ASTs.
  This allows for multiple user-entered expressions to interact with
  each other (e.g. previous statements can modify a global environment
  to affect future evaluations)

- Created VisitException class to better facilitate the separation of
  sources of errors that arise while lexing, parsing and walking user
  input.  (For an evaluator, WalkException is a runtime error).

- Renamed Repl to Main. Rewrote it to create a generic instance of
  PersistentWalker wrapped around a visitor of a class specified on
  the command line

- There is only one visitor class at this time: Evaluator.
  
Example Usages:
- To use as a Repl for a standard interpretor (expression evaluator):
  > $(JAVA_EXEC) Main -w Evaluator -
  OR more simply:
  > $(JAVA_EXEC) Main -

- To evaluate a file of expressions called foo.txt:
  > $(JAVA_EXEC) Main -w Evaluator foo.txt
  OR more simply:
  > $(JAVA_EXEC) Main foo.txt


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages