rascal | Rascal meta-programming language | Parser library

 by   usethesource Java Version: v0.28.11 License: Non-SPDX

kandi X-RAY | rascal Summary

kandi X-RAY | rascal Summary

rascal is a Java library typically used in Utilities, Parser applications. rascal has no bugs, it has no vulnerabilities, it has build file available and it has high support. However rascal has a Non-SPDX License. You can download it from GitHub.

This is the core implementation of the Rascal meta-programming language. It contains the interpreter, the parser generator, the parser run-time, the standard library, the online documentation and the type checker. Rascal is used in practice, but we consider it to be alpha software because we are still improving the language. For questions use the rascal tag on StackOverflow.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              rascal has a highly active ecosystem.
              It has 359 star(s) with 75 fork(s). There are 25 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 492 open issues and 1211 have been closed. On average issues are closed in 101 days. There are 6 open pull requests and 0 closed requests.
              OutlinedDot
              It has a negative sentiment in the developer community.
              The latest version of rascal is v0.28.11

            kandi-Quality Quality

              rascal has 0 bugs and 0 code smells.

            kandi-Security Security

              rascal has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              rascal code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              rascal has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              rascal releases are available to install and integrate.
              Build file is available. You can build the component from source.
              rascal saves you 116837 person hours of effort in developing the same functionality from scratch.
              It has 124081 lines of code, 14964 functions and 807 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed rascal and discovered the below as its top functions. This is intended to give you an instant insight into rascal implemented functionality, and help decide if they suit your requirements.
            • Visits a catch clause
            • Visit an AnnotationTypeDeclaration node
            • Visit a Block
            • Visit an ImportDeclaration node
            • Visit this node
            • Visit a wildcard
            • Visit a type parameter
            • Visit a Switch Statement
            • Visit a single variable declaration
            • Visit a NormalAnnotation node
            • Visit a Try Statement
            • Visit a ParameterizedType
            • Visit an array creation
            • Visit a field
            • Processes the package declaration
            • Visit a SuperMethodInvocation node
            • Visit InfixExpression
            • Visit a VariableDeclarationStatement
            • Visit a VariableDeclarationExpression
            • Visits an enum constant
            • Visit a constructor call
            • Visit a compilation unit
            • Visit a SuperConstructorInvocation node
            • Visit a For Statement
            • Visit a method declaration
            • Visit a type declaration
            • Visit an enum declaration
            • Visit a ClassInstanceCreate
            • Visit an AnnotationTypeMemberDeclaration node
            • Visit an ArrayInitializer node
            • Visits a ConditionalExpression
            Get all kandi verified functions for this library.

            rascal Key Features

            No Key Features are available at this moment for rascal.

            rascal Examples and Code Snippets

            No Code Snippets are available at this moment for rascal.

            Community Discussions

            QUESTION

            Preserving whitespace in Rascal when transforming Java code
            Asked 2021-Dec-17 at 13:13

            I am trying to add instrumentation (e.g. logging some information) to methods in a Java file. I am using the following Rascal code which seems to work mostly:

            ...

            ANSWER

            Answered 2021-Dec-17 at 13:13

            Alas, capturing whitespace with a concrete pattern is not a feature of the current version of Rascal. We used to have it, but now it's back on the TODO list. I can point you to papers about the topic if you are interested. So for now you have to deal with this "damage" later.

            You could write a Tree to Tree transformation on the generic level (see ParseTree.rsc), to fix indentation issues in a parse tree after your transformation, or to re-insert the comments that you lost. This is about matching the Tree data-type and appl constructors. The Tree format is a form of reflection on the parse trees of Rascal that allow any kind of transformation, including whitespace and comments.

            The parse error you talked about is caused by not using the start non-terminal. If you use parse(#start[CompilationUnit], ...) then whitespace and comments before and after the CompilationUnit are accepted.

            Source https://stackoverflow.com/questions/70393270

            QUESTION

            Changing the working directory when using the exec function in Rascal
            Asked 2021-Dec-12 at 14:36

            I am executing a command in Rascal on Windows 10 (some batch file) which in itself works fine:

            ...

            ANSWER

            Answered 2021-Dec-12 at 14:36

            The working dir parameters is a so called "keyword parameter" which you call using this syntax:

            Source https://stackoverflow.com/questions/70324375

            QUESTION

            Use imported Algebraic Data Type in eval
            Asked 2021-Sep-01 at 11:55

            I'm using the eval function to evaluate an abstract list pattern against a list and it keeps coming up with an Undeclared Variable error. Below is included a small reproducible example.

            ...

            ANSWER

            Answered 2021-Sep-01 at 11:55
            • eval is not an often used function in Rascal; do you really need to dynamically create patterns?
            • there is the node pattern: (str name)() which in this case would match any constructor with no arguments
            • the real answer is that if you do import the right modules in the call to eval those modules will be cached by the interpreter which is used by the eval function
            • so that would not be slow
            • however, module reloading is not well-supported and you might have to restart the shell to get a fresh version into the eval evaluator.

            Source https://stackoverflow.com/questions/69001593

            QUESTION

            Categorising syntax in Eclipse outline
            Asked 2021-Aug-13 at 17:24

            I'm trying to create an outline for a syntax definition I create in rascal. I've managed to make the various object appear in the outline by simply adding label annotations like recommended in the documentation. However, I would also like to "categorise" these objects so that all the objects of the same type end up under a common collapsible category. Like the way that Rascal's outline is with all the annotations, functions, variables, tests and so on sorted into their own categories. I haven't found anything really in the documentation about it. I've tried applying @Category to the syntax and to the AST, neither really worked

            ...

            ANSWER

            Answered 2021-Aug-13 at 17:24

            You can nest nodes like so:

            Source https://stackoverflow.com/questions/68739405

            QUESTION

            How to implode an embedded choice of alternative symbols?
            Asked 2021-Jul-16 at 09:33

            I have this syntax definition

            ...

            ANSWER

            Answered 2021-Jul-16 at 09:33

            Turns out I was overcomplicating the whole thing. Instead of trying to have a union of types I simply added an additional construction to RULEPART that could accommodate COMMAND. I think I might have been also initially confused about some of the issues because I had bugs in other parts of the code that I was misinterpreting as being caused by this problem.

            Source https://stackoverflow.com/questions/68376748

            QUESTION

            Rascal module not linking to Java class
            Asked 2021-Jul-05 at 13:39

            I'm attempting to create a Socket library in Rascal to operate a Java TCP socket class. For this the following basic setup is used: (src)>(Network)>(Socket.java, Socket.rsc) [1]: https://i.stack.imgur.com/a66RS.png

            When attempting to import the Network::Socket module into a Rascal Terminal the following error occurs: "Cannot link method Network.Socket because: class not found"

            The Rascal module:

            ...

            ANSWER

            Answered 2021-Jul-05 at 13:39

            The fault laid in some metadeta of the eclipse project being faulty.

            Creating a new project with the exact same setup and files made it work.

            Edit: Believed cause of error is renaming the project

            Source https://stackoverflow.com/questions/68194218

            QUESTION

            Match Symbol specific number of times
            Asked 2021-Jun-13 at 10:25

            When defining a syntax, it is possible to match 1 or more times (+) or 0 or more times (*) similarly to how it is done in regex. However, I have not found in the rascal documentation if it is possible to also match a Symbol a specific amount of times. In regex (and Rascal patterns) this is done with an integer between two curly brackets but this doesn't seem to work for syntax definition. Ideally, I'd want something like:

            ...

            ANSWER

            Answered 2021-Jun-13 at 10:25

            No this meta syntax does not exist in Rascal. We did not add it.

            You could write an over-estimation like this and have a post-parse filter reject more than 5 items:

            Source https://stackoverflow.com/questions/67953186

            QUESTION

            display data from table with ajax laravel 8
            Asked 2021-May-26 at 14:20

            I want to show the data of table in a form for updating it.

            So I'm using this code :

            ...

            ANSWER

            Answered 2021-May-26 at 13:56

            You can give classes to your p tags inside your card .Then , whenever user click on edit simply use .closest and .find() to get values from p tags and show them inside modal inputs .

            Demo Code :

            Source https://stackoverflow.com/questions/67705802

            QUESTION

            How to create a set containing different types
            Asked 2021-Jan-06 at 14:04

            How can I create a set containing a loc, int and string? In the example below it seems my map is converted to the container type ' value'. I would like to use the characteristics of a set; Only one element should be contained in the set and the order does not matter . In the example below the same elements are contained in what I was hoping to be a set.

            ...

            ANSWER

            Answered 2021-Jan-06 at 14:04

            Something weird is going on . First mySet is a map, and then you add a set to it and the variable mySet is suddenly a set that contains the previous map and the new element you added. It looks to me that += has a bug.

            If you want to add several elements to a set, you should start with a set and add elements to it like so:

            Source https://stackoverflow.com/questions/65594773

            QUESTION

            Can Rascal return the operating system in method?
            Asked 2020-Dec-24 at 10:28

            In java I would use: System.getProperty("os.name") to get Java to return the operating system. Is something similar possible in Rascal? My goal is to write a method to write text files to a folder that works OS-independent. Something like;

            ...

            ANSWER

            Answered 2020-Dec-23 at 17:03

            If you just use a home URL like home:///path/to/file the writeFile function will take care of the rest. There is also cwd:// for the current working directory and tmp:/// for the temp folder.

            Source https://stackoverflow.com/questions/65426746

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install rascal

            You can download it from GitHub.
            You can use rascal like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the rascal component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/usethesource/rascal.git

          • CLI

            gh repo clone usethesource/rascal

          • sshUrl

            git@github.com:usethesource/rascal.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Parser Libraries

            marked

            by markedjs

            swc

            by swc-project

            es6tutorial

            by ruanyf

            PHP-Parser

            by nikic

            Try Top Libraries by usethesource

            capsule

            by usethesourceJava

            vallang

            by usethesourceJava

            clair

            by usethesourceJava

            rascal-eclipse

            by usethesourceJava

            flybytes

            by usethesourceJava