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

Questions about the online desatomat tool, CTRE, and pcre.hpp #320

Open
alexios-angel opened this issue Aug 6, 2024 · 1 comment
Open
Labels

Comments

@alexios-angel
Copy link

I am trying to recreate your desatomat tool in python so I can make a LL(1) ANTLR & EBNF grammer parser.

The following types are missing from pcre.hpp but were present in the output of the desatomat tool:

  • asserts
  • atom
  • atom_in_capture
  • atom_repeat
  • atom_repeat_in_capture
  • backslash_set
  • block_name
  • character
  • character_class
  • character_in_capture
  • class_named
  • mode_switch
  • preblock
  • set
  • setitem
  • setitem2
  • string
  • string_in_capture

I have some questions about the tool:

  • Were these optimized out of the pcre grammar?
  • Why not make a rule called "ignore" and whenever it is come across it you ignore it and don't place it on the stack?
  • If I write my grammar in Extended Desátomatu Syntax and replace the pcre.hpp with the output from the desatomat tool would it work?
  • Is the tool on the website less advanced than what is used to generate pcre.hpp?
  • What is Extended Desátomatu Syntax? I have never heard of it in any literature. Is it a variant of EBNF?
  • Why not use EBNF/PEG to describe the regex grammar? Is there something special about EDS?
  • Why are comments not supported by CTRE? You can split the regex by comments, join the regex_results, and then feed the resulting string back into CTRE
@alexios-angel alexios-angel changed the title Discrepancies between generated code from online desatomat tool and pcre.hpp Questions about the online desatomat tool and pcre.hpp Aug 6, 2024
@alexios-angel alexios-angel changed the title Questions about the online desatomat tool and pcre.hpp Questions about the online desatomat tool, CTRE, and pcre.hpp Aug 6, 2024
@hanickadot
Copy link
Owner

hanickadot commented Aug 6, 2024

Were these optimized out of the pcre grammar?

yes

Why not make a rule called "ignore" and whenever it is come across it you ignore it and don't place it on the stack?

not sure if I follow you, why?

If I write my grammar in Extended Desátomatu Syntax and replace the pcre.hpp with the output from the desatomat tool would it work?

yes, if you use right generator

What is Extended Desátomatu Syntax? I have never heard of it in any literature. Is it a variant of EBNF?

it's my own, it's the syntax you can see in pcre.gram

Why not use EBNF/PEG to describe the regex grammar? Is there something special about EDS?

because long time ago I did my thing and start building it with it, and I'm not going to change that now, especially I have a lot of my own transformations which would be hard to replicate somewhere else with significant time investment

Why are comments not supported by CTRE? You can split the regex by comments, join the regex_results, and then feed the resulting string back into CTRE

Because you are in C++, you can put comment into normal code and won't pay price for its parsing.

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

No branches or pull requests

2 participants