Skip to content

Conversation

@OleksiiKovalov
Copy link
Contributor

@OleksiiKovalov OleksiiKovalov commented Nov 23, 2021

What does this PR do?

  1. Makes grammar case insensitive
  2. simplifies lexer by removes literals which are not directly used by production rules (except lists of "literals which can be used as identifiers")
    Why?
  3. according to https://docs.oracle.com/cd/A97630_01/appdev.920/a96624/02_funds.htm#10519 "PL/SQL is not case sensitive, so lower-case letters are equivalent to corresponding upper-case letters except within string and character literals." so it is good to follow this rule. also, using "uppercase charstream" will break case of strings/literals - it may be vital for code analysis
  4. code size is less and slightly faster. much faster compilation.
    not-used literals removed;
    lexer size 1056179 -> 343687 bytes
    parser size 3096431 -> 2752576 bytes

How is it checked?
using standard post-commit checks/ci

@OleksiiKovalov
Copy link
Contributor Author

hi @KvanTTT , @kaby76
i need to re-generate .tree file for one of the example script ( sql/plsql/examples/create_procedure.sql.tree )
How can I do that? Please advise
thanks!

@kaby76
Copy link
Contributor

kaby76 commented Nov 24, 2021

hi @KvanTTT , @kaby76 i need to re-generate .tree file for one of the example script ( sql/plsql/examples/create_procedure.sql.tree ) How can I do that? Please advise thanks!

Yes, that's a good question. The way I normally do this is to generate a parser using trgen -t Java and call the executable with the -tree option. But, I don't know the official way to generate the .tree files.

@OleksiiKovalov
Copy link
Contributor Author

The way I normally do this is to generate a parser using trgen -t Java and call the executable with the -tree option

Works for me, thanks!

@OleksiiKovalov OleksiiKovalov marked this pull request as ready for review November 24, 2021 15:53
@OleksiiKovalov
Copy link
Contributor Author

hi @KvanTTT ,
please take a look

@teverett teverett added the plsql label Dec 6, 2021
@KvanTTT
Copy link
Member

KvanTTT commented Dec 7, 2021

Also postponed until status resolving of case insensitivity feature.

@KvanTTT
Copy link
Member

KvanTTT commented Dec 25, 2021

options { caseInsensitive=true; } will be available since the next version of ANTLR. That's why such transformation will not be needed.

@KvanTTT KvanTTT closed this Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants