Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alex slow on big regular expressions #163

Open
andreasabel opened this issue Oct 8, 2020 · 0 comments
Open

Alex slow on big regular expressions #163

andreasabel opened this issue Oct 8, 2020 · 0 comments

Comments

@andreasabel
Copy link
Member

From this LBNF file, compiled with BNFC-2.8.4,

EInt.  Exp ::= Integer;
EPlus. Exp ::= Exp "+" Integer;

comment "anananas" "anananas";

I get a huge regular expression to recognize block comments (started and ended by anananas):
Lex.x.txt

Alex does produce a valid lexer from this, but this takes a rather long time.

I wonder whether Alex could be optimized by introducing sharing into the regular expressions and thus reuse automata generated from subexpressions (rather than computing them again).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant