rvirding / leex Goto Github PK
View Code? Open in Web Editor NEWLexical analyzer generator for Erlang
License: BSD 2-Clause "Simplified" License
Lexical analyzer generator for Erlang
License: BSD 2-Clause "Simplified" License
This is currently needed for precise error messages in both https://github.com/graphql-elixir/graphql and https://github.com/absinthe-graphql/absinthe.
in stackoverflow i found a regex for regex:
/^((?:(?:[^?+*{}()[\]\\|]+|\\.|\[(?:\^?\\.|\^[^\\]|[^\\^])(?:[^\]\\]+|\\.)*\]|\((?:\?[:=!]|\?<[=!]|\?>)?(?1)??\)|\(\?(?:R|[+-]?\d+)\))(?:(?:[?+*]|\{\d+(?:,\d*)?\})[?+]?)?|\|)*)$/
but leex doesnt support ^and$ in match rules, is there anyway else to doing this ?
How to declare for instance a tokenizer where separators are declared in beginning of file to parse ?
I think to EDIFACT or ANSI X12 EDI files where separators are declared in beginning.
It could be nice to pass value of a macro while running lexer, or a syntax to pick characters in some position or catching ereg on file itself, instead having to do templates to generate xrl file and compile at runtime.
Hello,
I would like to usw leex in conjunction with yecc on a compiler project of mine.
I am sorry to bother you with this but I encountered a Problem, when trying to parse c-style comments, e.g.,
/* my comment */
as a Single token. The delimiters are not single characters, so a pattern like "[^"]*" as would work for strings doesn't work here.
Instead, lazy (ungreedy) pattern matching would be necessary. Unfortunately, a lazy pattern like
/\*.*?\*/
has not worked.
I am aware, that lazy pattern matching is not a standard feature of a lexer and that I can circumvent this problem by using multiple lexers (see http://flex.sourceforge.net/manual/Why-doesn_0027t-flex-have-non_002dgreedy-operators-like-perl-does_003f.html) but it feels like I am missing something. Especially since the re package for erlang regexes supports lazy patterns (see http://www.erlang.org/doc/man/re.html and https://arifishaq.wordpress.com/2013/11/13/playing-with-regular-expressions/).
If there is any way to lex the input string in a single pass with a single lexer I would appreciate your input.
Best regards
Jörgen
The link to the leex and yecc article are stale. I believe this is the new link:
https://github.com/rvirding/leex link to 'read more about leex' is a 404 link
to http://relops.com/blog/2014/01/13/leex_and_yecc/
i can not solve that leex..
that's i trying create bbcodes-to-html tool, with leex - first step
https://gist.github.com/221V/ddc9ba71755676a8c344717b095a6c15
can you help me please?
thanks
Erlang Version: R18.3
when i use this regex in leex(*.xrl):
\/\*(\*(?!\/)|[^*])*\*\/
i got this error:
bad regexp `illegal character ?'
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.