Giter Club home page Giter Club logo

snowflake's Introduction

snowflake's People

Contributors

mackenzie-high avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

snowflake's Issues

Add optional timeout and recursion depth limit directives.

In the future, it would be nice for Snowflake to support user-defined timeouts and recursion-depth-limits in order to make the parser behave better when one accidentally creates a left-recursive grammar. In addition, it may be possible to add functionality to limit the (global) maximum number of match attempts.

Add a fluent find() method to ITreeNode.

Add findChild(String name) : ITreeNode and findChildren(String name) : List to the ITreeNode class. These are simply convenience methods that perform a DFS by calling the static equivalents that already exist.

Investigate generating a singe-file "no-dependency" parser.

Currently, users must have the snowflake library on the CLASSPATH in order to use a generated parser. This can be undesirable in some circumstances. It may be possible to create a single class file containing the generated parser, generated visitor, and a copy of the parser library embedded therein as nested classes. This would be a cheap way of providing the desired functionality.

Java escape sequences in string rules cause invalid code generation.

Suppose that you have the following grammar rules:

ESCAPE_B = "\b";
ESCAPE_T = "\t";
ESCAPE_N = "\n";
ESCAPE_F = "\f";
ESCAPE_R = "\r";
ESCAPE_SL = "\";
ESCAPE_SQ = "'";

Then, the following parser configuration code will be generated.
g.str("ESCAPE_B", "\b");
g.str("ESCAPE_F", "\f");
g.str("ESCAPE_N", "\n");
g.str("ESCAPE_R", "\r");
g.str("ESCAPE_SL", "\");
g.str("ESCAPE_SQ", "'");
g.str("ESCAPE_T", "\t");

However, the correct code would be:
g.str("ESCAPE_B", "\b");
g.str("ESCAPE_F", "\f");
g.str("ESCAPE_N", "\n");
g.str("ESCAPE_R", "\r");
g.str("ESCAPE_SL", "\\");
g.str("ESCAPE_SQ", "\'");
g.str("ESCAPE_T", "\t");

Work Around:
ESCAPE_B = '' , 'b';
ESCAPE_T = '' , 't';
ESCAPE_N = '' , 'n';
ESCAPE_F = '', 'f';
ESCAPE_R = '', 'r';
ESCAPE_SL = '','";
ESCAPE_SQ = '', "'";

This is a bug in the code-generator, not in the snowflake library itself.

Improve the auto-generated visit() method.

Currently, the code-generator generates a visit() method containing an if-elif-else comprised of string equality tests. This should be converted to either a string-switch or a HashMap of lambdas.

Add a stop() functionality to the parser library.

Currently, there is not a way to force stop a parser. This functionality should be added. Then, as a separate addition, the functionality should be integrated with the GUI in order to allow the user to stop parsing attempts at will.

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.