Skip to content

Header only C++ library for tokenizing Excel formulas

License

Notifications You must be signed in to change notification settings

pyxll/xlfparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMake

xlfparser

Header only C++ library for tokenizing Excel formulas

Modern C++ port of ewbi's Excel formula parser (http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html).

See also https://github.com/lishen2/Excel_formula_parser_cpp, which this code was originally based on.

Some advantages of xlfparser over Excel_formula_parser_cpp are:

  • Implemented in a single header so easier to integrate.
  • Support for wide strings.
  • Doesn't require any 3rd party dependecies (eg. PCRE).
  • Fewer allocations by avoiding string concatenations.

Example Usage

#include <xlfparser.h>
#include <iostream>

int main()
{
    std::string formula("=SUM(1,2,3)");
    auto tokens = xlfparser::tokenize(formula);
    
    for (const auto& token: tokens)
        std::cout << token.value(formula) << std::end;
        
    return 0;
}

See also example.cpp.

About

Header only C++ library for tokenizing Excel formulas

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages