Code Monkey home page Code Monkey logo

grun.net's Introduction

Grun.Net

A set of tools written in C# for testing Antlr4 generated C# grammar assemblies. These tools are meant to supplement the need to continually test with the Antlr java TestRig assembly. If you want support for the Antlr4.Runtime assembly, install version 1.3.23320.0. If you want support for the Antlr4.Runtime.Standard assembly, then install 2.0.23321.1 instead. You may install both versions together if needed, the 2.x runtime standard versions will install alongside the original without issues. In the future I will work on a version that supports both dynamically, but the current design of the app makes this impossible.

Please create issues for any bug fixes or feature requests. I want to make this tool better and help improve C# ANTLR development.

.Net Framework CI License GitHub release

Maintenance GitHub issues open GitHub issues-closed Average time to resolve an issue

PRs Welcome GitHub pull-requests

Twitter URL

Grun.Net is primarily composed of two testing tools: Grun.exe and GrunWin.exe. Grun.exe is a command line testing tool similar to the existing Antlr TestRig. GrunWin.exe is a graphical testing tool with a host of testing features.

Further information on the features and usage of each tool may be found in the wiki.

Below is a demonstration video showing how to use these tools. Demonstration Video

Editor Sample

grun.net's People

Contributors

wiredwiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tnsr1 stah

grun.net's Issues

Abstract away dependencies on the Antlr4 runtime

I need to refactor the project design to abstract all dependencies on the Antlr4 runtime assemblies. This will allow it to have different providers for different runtime versions all supported in the same tool.

Fix graph zoom bug

If the graph is rebuilt while the user is zoomed in, the zoom factor goes haywire due to math mistake.

Parser rules sometimes do not match in graph

The current method for extracting the parser rules can sometimes result in them being in the wrong order and thus getting mismatched to the graph node names. This will be fixed in the next release later today.

Add Drag/Drop support to GrunWin tool

Add support to drag and drop assemblies and source code files to GrunWin. If an assembly is dropped onto the form, it should find all ANTLR grammars within the assembly and then load the grammar if there is only one. If there are multiple grammars, the the user should be prompted which grammar to load. Any non-assembly file should be inspected to see if it appears to be valid ascii source. If so, then the contents should be loaded into the code editor window.

Add auto-reload feature to GrunWin

GrunWin should be modified to detect changes to the loaded grammar assembly and then reload the assembly in response. This will make grammar testing more seamless and easy for the user.

Grun.Net does not seem to work with Antlr4.Runtime.Standard

Grun.Net does not seem to work with a net472 assembly built against Antlr4.Runtime.Standard v4.8. At assembly.GetTypes(), line 83, Scanner.c "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information" Note: Antlr4cs is several versions behind the current Antlr code base, now 4.8. Version 4.6.6 in the Antlr4 code tree was last updated a year ago, but forked from 4.6, which was released in 2016! 4.7 was released in 2017. 4.8 was released a few months ago. The Antlr4cs code hasn't been updated by Harwell for over a year, and unclear if he is maintaining that codebase now. Other than that and a few minor problems (lexer error messages are not displayed, selection of input or tokens not reflected in selection in tree), the code works well.

Add graphical parse tree

Add a graphical parse tree control to GrunWin using the Microsoft Automated Graph Layout library.

Console syntax highlighting breaks on line wrap

When a source code line would be forced to wrap in the console, the syntax highlighting breaks badly. The syntax highlight code in the console needs to be modified to detect line wrapping.

Re-design assembly loading logic

It occurs to me that while locking the assembly for the console app isn't a big deal, it certainly is for the GrunWin tool, which presumably a developer will have open and running while they are making changes to their grammar, recompiling and re-testing. Given this, the assembly loading logic needs to use an AppDomain so that it can be dumped and reloaded on demand.

Fix text drag drop bug

When dragging a small text sample onto the editor window that already contains a larger sample, causes syntax highlighting to explode.

Add syntax highlighting to the code editor window in GrunWin

The editor should support intuitive selection of token colors and add syntax highlighting to any grammar by default. The default colors may or may not make some folks happy. To address this, the editor should support dynamic loading of any IEditorGuide instances in the target assembly or any other assemblies in the same folder or in a "Guides" folder within the GrunWin directory itself. GrunWin will attempt to find an IEditorGuide that matches the current grammar and use it in place of the default intuitive highlighting behavior.

Add menu strip to GrunWin

Add a menu strip with items for loading new grammars, exiting the app and toggling various parse options.

Add full color customization

Add the ability for the user to fully customize the colors used in heuristic syntax highlighting as well as the graph window. This should help make the tool as friendly to color blind users as well as those who just don't like the default colors.

Fix delays caused by constant re-parsing

With a large enough sample of code the constant rebuilding of the parse tree graph can slow the editor down. While this sin't unexpected under the current design, it is something that should be fixed before a full release. It will simply take some basic threading magic.

Excessively huge graphs freeze the client

While working with a grammar of my own I tried a sample code that resulted in just shy of 18,000 graph nodes and noticed that the Microsoft's graph viewer locks up the UI while trying to paint so many. So, given that 18K nodes isn't useful anyway, nor is even 1,000, I'm going to add a maxNodeRender setting in the configuration. The default will start at 500. The tree view portion will still render so you can simply click the subset of the tree you wish to graph as normal and get something more usable that also doesn't spike your CPU and lock up the UI for 10 seconds. I should have a release with this soon.

Add source to token selection

Add ability to select the token from the token window that corresponds to the current cursor position in the code editor window.

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.