Code Monkey home page Code Monkey logo

Comments (2)

goto40 avatar goto40 commented on June 10, 2024

Thank you for this interesting suggestion.

  • From an end-user point of view it is a valid extension.
  • From the implementation-of-textx point of view it should be carefully analyzed what kind of variations are possible and allowed and what are the consequences of such a change (e.g. is it also allowed to mix references and non-references: Rule: x=(A | [B]);?).
    • @pvmm Maybe the following simple alternative is also acceptable for you? Define a new rule FactionOrFloatOrInt: FRACTION | FLOAT | INTEGER; and use Number: value=FactionOrFloatOrInt;.
    • @igordejanovic Maybe such a transformation could be automated, if we include such an extension.

I think it is not a trivial change...

from textx.

igordejanovic avatar igordejanovic commented on June 10, 2024

@pvmm Thanks for the suggestion.

I agree with @goto40. It would be a non-trivial change. Furthermore, if we allow for arbitrary expressions in the RHS of the assignment it would be hard to deduce the meta-model. What would be the meta-class of the RHS for complex expressions? On the other hand, if allowed expressions are somehow constrained it would be difficult to explain those constraint to the end-users. Now it is very simple. You can use only rule references and plain matches (with repetition modifiers for repeatable assignments). I think the way it is now is the best trade-off between the expressive power and the implementation complexity.

I'm closing this issue as wontfix but feel free to reopen if you want to discuss further.

from textx.

Related Issues (20)

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.