GithubHelp home page GithubHelp logo

sax / grammar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gmai2006/grammar

0.0 0.0 0.0 4.91 MB

ANTLR4 grammar for PowerBuilder and PowerBuilder DataWindow

License: MIT License

Java 84.61% ANTLR 1.82% PLpgSQL 9.75% PowerBuilder 3.81%

grammar's Introduction

Grammars

ANTLR4 grammars for PowerBuilder, DataWindow, MySql, and PostgreSQL grammars

PowerBuilder grammars

There are two versions of PB: (1) general and (2) grammar that supports comments extraction.

To generate parser and lexer for PB no support for comment run: gradle generatePb

To generate parser and lexer for PB that supports comment run: gradle generatePbWithComment

To test all run: gradle testPb

To test all run: gradle testPbWithComments

Change History

  • Add a grammar that parse comments
  • Fixed the ambiguous HEADER. Put it into the hidden channel
  • Fixed the function call statement that should accept argument types (string literal, primitive data types)
  • Simplify the grammar. Boolean expression is a expression, not the other way around like the implemetation of the version 3 and the ported version. The generated parse tree should be shorter and clean.
  • Add different types of function calls
  • Add more test files to unit test
  • Add support for embedded SQL
  • Add try-catch
  • Add comments

DataWindow

To generate parser and lexer run: gradle generatePostgres

Tested against 120 DataWindow files.

Test files are from this project

MySql

To generate parser and lexer run: gradle generateMySql

To test all run: gradle testMySql

#Change history

  • Support mix case. No need to use ChangeCase any more
  • Add BIND_VAR to handle plSql :<variable_name>
  • Test against more 100 Sql files
  • Resolve the expression issue with minus minus condition #1525 (antlr/grammars-v4#1525)

PostgreSQL

To generate parser and lexer run: gradle generatePostgres

To test all run: gradle testPostgres

Change history

  • A modified version from the ANTLR4 repo, which should be language agnostic
  • Replace all recursive rules with iterative rules (list: list item => item+) => reduce the parsetree size
  • Replace or epsilon rules with optional => remove all the empty node on the parse tree
  • Add a base class for the Lexer per kaby76

grammar's People

Contributors

gmai2006 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.