Skip to content

zhouxs1023/eigenmath_pratt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eigenmath with a Pratt parser

Overview

I took George Weigt's Eigenmath project and replaced the recursive descent parser in scan.cpp with a Vaughan Ronald Pratt parser in pratt.cpp.

Building

To build the project, you need GCC under Linux and the following command in the project's directory:

$ make

This will produce object files *.o and an executable math in the project's directory.

Testing

To test the program, you can use the provided test-script.txt:

$ ./math test-script.txt

You can also run the command selftest:

$ ./math
> selftest

To quit the program, enter Ctrl-C:

$ ./math
> ^C
$

References

In this implementation of Pratt's parser I made use of the material presented in this article:

  • Top Down Operator Precedence, Vaughan R. Pratt, 1973 available at http://tdop.github.io/. Original description of Pratt's algorithm.

The concept of nbp (next binding power) is from:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published