Giter VIP home page Giter VIP logo

axe's People

Contributors

gbresearch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

axe's Issues

convert_iterator doesn't work with const char*

convert_iterator (and e.g., r_ucase and other converting rules) assume that the iterator type is a C++ iterator, and not a const char*.
This means parsing rules expect an std::string or other container, and std::string_view will case a compilation error.

How to add semantic attributes

Hi,
I like the library but the documentation does not show how to add semantic elements to the parse rules. Since there's no wiki, i'm asking here.

The documentation says that there is a Data element of the result (that we can fetch using the get_as<> function), which I think can be used but my question how can I define the semantic element so I can build an AST using that data element?. Yacc has $$, $1, $2... to do this, so does axe have an equivalent? For instance how to do something like the following (if possible):

struct value{
  int     intVal;
  double  doubleVal;  
}
auto number = double_ >>[](auto a, auto b){ $$ = value{ -1, atof(*a)}; }
            | _int;   >>[](auto a, auto b){ $$ = value{ atoi(*a), -1.0}; }

auto expr = (number & '+' & number )  >> [](auto a, auto b){
   if ($1.intVal< 0) 
      $$ = value{-1,  $1.doubleVal + ($2.intVal < 0 ?  $2.doubleVal < 0 :  $2.intVal)};
   else 
      $$ = value{$1.intVal+ ($2.intVal < 0 ?  $2.doubleVal < 0 :  $2.intVal)};
};

Thanks

VC2019 throws error.

Severity Code Description Project File Line Suppression State
Error C2386 'parse_tree_result_t': a symbol with this name already exists in the current scope UnrealTable C:\Users\foo\Documents\Unreal Projects\AXE\include\axe_composite.h 109

... so I really like the project... but IDK... sorta blocked here. It twiggs many buttons that make me happy, tho.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.