๐Ÿงน Error correcting parser plugin

Related tags

Utility tidyparse
Overview

Tidyparse

The main goal of this project is to speed up the process of learning a new language by suggesting ways to fix source code.

Tidyparse expects two files in the same directory -- one ending in *.tidy which contains the string to parse (with optional holes) and one ending in *.cfg which contains the grammar. If you provide a string containing holes, it will provide some suggestions inside a tool window on the right hand side (can be opened by pressing Shift twice in rapid succession and searching for Tidyparse. If the string contains no holes, it will print out the parse tree in Chomsky normal form.

Getting Started

To use this plugin, first clone the parent repository and initialize the submodule like so:

git clone https://github.com/breandan/tidyparse && \
cd tidyparse && \
git submodule update --init --recursive && \
./gradlew runIde

To launch IntelliJ IDEA with the plugin installed, run: ./gradlew runIde from the parent directory.

Open a new project, then create a root directory to store the grammar (*.cfg) and test cases (*.tidy).

To view the parse tree, press Shift twice in rapid succession and search for ๐Ÿ”Tidyparse to open the tool window.

For example, create the following directory structure:

ocaml
โ”œโ”€โ”€โ”€ ocaml.tidy
โ””โ”€โ”€โ”€ ocaml.cfg

The file ocaml.cfg can contain this grammar:

 S -> X
 X -> B | I | F | P
 P -> I O I
 F -> IF | BF
IF -> if B then I else I
BF -> if B then B else B
 O -> + | - | * | /
 I -> 1 | 2 | 3 | 4 | IF
 B -> true | false | B BO B | ( B ) | BF
BO -> and | or

The file ocaml.tidy can contain this test case:

if true then if true then 1 else 2 else 3

This should produce the following output (in Chomsky normal form):

โœ… Current line parses!
I
โ”œโ”€โ”€ if
โ””โ”€โ”€ B.then.I.else.I
    โ”œโ”€โ”€ true
    โ””โ”€โ”€ then.I.else.I
        โ”œโ”€โ”€ then
        โ””โ”€โ”€ I.else.I
            โ”œโ”€โ”€ I
            โ”‚   โ”œโ”€โ”€ if
            โ”‚   โ””โ”€โ”€ B.then.I.else.I
            โ”‚       โ”œโ”€โ”€ true
            โ”‚       โ””โ”€โ”€ then.I.else.I
            โ”‚           โ”œโ”€โ”€ then
            โ”‚           โ””โ”€โ”€ I.else.I
            โ”‚               โ”œโ”€โ”€ 1
            โ”‚               โ””โ”€โ”€ else.I
            โ”‚                   โ”œโ”€โ”€ else
            โ”‚                   โ””โ”€โ”€ 2
            โ””โ”€โ”€ else.I
                โ”œโ”€โ”€ else
                โ””โ”€โ”€ 3

To view the grammar, test case and parse tree all together, the development environment may be configured as follows:

Screen Shot 2022-05-12 at 11 00 19 PM

Tidyparse also accepts holes (_) in the test case. Providing such a test case will suggest candidates that are consistent with the provided CFG.

Screen Shot 2022-05-12 at 10 54 52 PM

Notes

  • Currently, rendering is done on-the-fly but may not reflect the current state of the editor. To refresh the display, type an extra whitespace character.
  • The grammar is sensitive to whitespace characters. Each nonterminal must be separated by at least one whitespace character.
  • There is currently no lexical analysis. Each terminal in the grammar corresponds to a single token in text. All names must be specified in the grammar.
You might also like...
๐ŸชŸ Pluggable Ktor plugin to implement Sentry for error handling and request contexts

๐ŸชŸ Ktor Plugin for Sentry Pluggable Ktor plugin to implement Sentry for error handling and request contexts. What is this library? This basically impl

Button for android with animations for transition and error states.
Button for android with animations for transition and error states.

Transition Button Android Preview Expand animation: Shake animation: Installation Gradle dependencies { implementation 'com.royrodriguez:transitionbu

A simple watchdog that detects Android ANR (Application Not Responding) error and throws a meaningful exception

ANR-WatchDog A simple watchdog that detects Android ANRs (Application Not Responding). Table of contents ANR-WatchDog Table of contents Why it exists

Create & Show progress, data or error views, the easy way!
Create & Show progress, data or error views, the easy way!

State Views for Android (BETA version) Create & Show progress, data or error views, the easy way! StateViews is based on ViewSwitcher mechanism and al

Error handling library for Android and Java

ErrorHandler Error handling library for Android and Java Encapsulate error handling logic into objects that adhere to configurable defaults. Then pass

Collects error messages ad sends them to Microsoft Teams or Telegram

ErrorCollector Logback-classic This projects aims to provide a convenient way to be notified if an error in on of your systems occurs. The appender wi

Robust error-handling for Kotlin and Android
Robust error-handling for Kotlin and Android

Code Complete: A Practical Handbook of Software Construction, on error-handling techniques: Consumer applications tend to favor robustness to correctn

See a pretty error screen when your Android app crashes
See a pretty error screen when your Android app crashes

WhatTheStack WhatTheStack is a library to make your debugging experience on Android better. It shows you a pretty error screen when your Android App c

Powerful Error Detector for Android
Powerful Error Detector for Android

Erratum Powerful Error Detector for Android Preview If an exception is detected, the exception activity is automatically launched. This activity also

A lightweight, good expandability Android library used for displaying different pages like loading, error, empty, timeout or even your custom page when you load a page
A lightweight, good expandability Android library used for displaying different pages like loading, error, empty, timeout or even your custom page when you load a page

ไธญๆ–‡ | English LoadSir ๐Ÿ‘‰ ๐Ÿ‘ˆ LoadSirๆ˜ฏไธ€ไธช้ซ˜ๆ•ˆๆ˜“็”จ๏ผŒไฝŽ็ขณ็Žฏไฟ๏ผŒๆ‰ฉๅฑ•ๆ€ง่‰ฏๅฅฝ็š„ๅŠ ่ฝฝๅ้ฆˆ้กต็ฎก็†ๆก†ๆžถ๏ผŒๅœจๅŠ ่ฝฝ็ฝ‘็ปœๆˆ–ๅ…ถไป–ๆ•ฐๆฎๆ—ถๅ€™๏ผŒๆ นๆฎ้œ€ๆฑ‚ๅˆ‡ๆข็Šถๆ€้กต้ข๏ผŒ ๅฏๆทปๅŠ ่‡ชๅฎšไน‰็Šถๆ€้กต้ข๏ผŒๅฆ‚ๅŠ ่ฝฝไธญ๏ผŒๅŠ ่ฝฝๅคฑ่ดฅ๏ผŒๆ— ๆ•ฐๆฎ๏ผŒ็ฝ‘็ปœ่ถ…ๆ—ถ๏ผŒๅฆ‚ๅ ไฝๅ›พ๏ผŒ็™ปๅฝ•ๅคฑๆ•ˆ็ญ‰ๅธธ็”จ้กต้ขใ€‚ๅฏ้…ๅˆ็ฝ‘็ปœๅŠ ่ฝฝๆก†ๆžถ๏ผŒ็ป“ๅˆ่ฟ”ๅ›ž ็Šถๆ€

Add error handling in RecyclerView
Add error handling in RecyclerView

MarsPhotosAPi Exercises Components Used Recycler View API enu The Second Image when i Turn off wifi . References https://developer.android.com/courses

A library that you can use in 4 different types(Success, Error, Warning, Info) written with Jetpack Compose.
A library that you can use in 4 different types(Success, Error, Warning, Info) written with Jetpack Compose.

Composable Sweet Toast A library that you can use in 4 different types(Success, Error, Warning, Info) written with Jetpack Compose. You can use this t

ViewStateLayout - Easy way to manage common state templates like loading, empty, error etc.!
ViewStateLayout - Easy way to manage common state templates like loading, empty, error etc.!

ViewStateLayout Easy way to manage common state templates like loading, empty, error etc.! How to Step 1. Add the JitPack repository to your build fil

Fast JSON parser for java projects

ig-json-parser Fast JSON parser for java projects. Getting started The easiest way to get started is to look at maven-example. For more comprehensive

Apk parser for java

APK parser lib, for decoding binary XML files, getting APK meta info. Table of Contents Features Get APK-parser Usage 1. APK Info 2. Get Binary XML an

APK parser for Android
APK parser for Android

APK Parser Features Retrieve basic apk metas, such as title, icon, package name, version, etc. Parse and convert binary xml file to text Classes from

Apk parser for java

APK parser lib, for decoding binary XML files, getting APK meta info. Table of Contents Features Get APK-parser Usage 1. APK Info 2. Get Binary XML an

A Java ePub reader and parser framework for Android.
A Java ePub reader and parser framework for Android.

FolioReader-Android is an EPUB reader written in Java and Kotlin. Features Custom Fonts Custom Text Size Themes / Day mode / Night mode Text Highlight

Open Graph Parser for Android

OpenGraphParser A small and easy to use library which provides the convenience of using Open Graph Protocol in Android very easily. Create previews fo

Owner
breandan
Student
breandan
Powerful Error Detector for Android

Erratum Powerful Error Detector for Android Preview If an exception is detected, the exception activity is automatically launched. This activity also

Ji Sungbin 5 Dec 3, 2022
Apk parser for java

APK parser lib, for decoding binary XML files, getting APK meta info. Table of Contents Features Get APK-parser Usage 1. APK Info 2. Get Binary XML an

Hsiafan 1.1k Jan 2, 2023
APK parser for Android

APK Parser Features Retrieve basic apk metas, such as title, icon, package name, version, etc. Parse and convert binary xml file to text Classes from

Jared Rummler 613 Dec 20, 2022
Apk parser for java

APK parser lib, for decoding binary XML files, getting APK meta info. Table of Contents Features Get APK-parser Usage 1. APK Info 2. Get Binary XML an

Hsiafan 1.1k Dec 18, 2022
Parser and Expression Evaluator for Logic Statements

LogicParser Parser and Expression Evaluator for Logic Statements: The steps behind the whole process of evaluating a given logic statement encompass:

Bฤƒrbuศ›-Dicฤƒ Sami 1 Dec 8, 2021
UE Capability parser used by smartphonecombo.it and cacombos.com

UE Capability Parser Warning Work In progress UE Capability parser used by smartphonecombo.it and cacombos.com $ java -jar uecapabilityparser.jar --he

Andrea Mennillo 4 Oct 16, 2022
Screen Capture Utils - A plugin to handle screen capture events on android and ios

Screen Capture Utils A plugin to handle screen capture events on android and ios ?? Initialize SDK late ScreenCaptureUtils screenCaptureUtils;

Chiziaruhoma Ogbonda 41 Apr 12, 2022
Android injection using the Anvil compiler plugin

Tangle creates Dagger bindings for Android classes using the Anvil Kotlin compiler plugin. This is meant to be an alternative to Hilt, for those who'd prefer to enjoy the faster compilation and better flexibility of Anvil.

Rick Busarow 67 Dec 29, 2022
Useful helpers that make it easier to implement maven-plugin mojos with kotlin

A library that makes writing powerful maven plugins even easier by providing kotlin extensions and convenience functions for common use cases.

TOOListicon 1 Nov 4, 2022
Social share - Social Sharing Plugin For Private Use only (Code without error checking)

Flutter Social Share plugin for sharing file to media with multiple (More option

MP IT SPACE 0 Mar 19, 2022