gbresearch / axe Goto Github PK
View Code? Open in Web Editor NEWAXE: a recursive descent parser generator C++ library
License: Boost Software License 1.0
AXE: a recursive descent parser generator C++ library
License: Boost Software License 1.0
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.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.