GithubHelp home page GithubHelp logo

Import support about packcc HOT 10 CLOSED

arithy avatar arithy commented on July 17, 2024 1
Import support

from packcc.

Comments (10)

arithy avatar arithy commented on July 17, 2024

PackCC does not have a functionality like "import".
Thanks for the suggestion.

I understand its usability, but currently I'm reluctant to realize it since it brings some complexity in PackCC's simpleness.
Let me only add this issue to the want list for the time being.
If there are strong requests by several users, I'll begin to implement it.

from packcc.

dolik-rce avatar dolik-rce commented on July 17, 2024

I believe import functionality should be quite easily implemented by custom PCC_GETCHAR. It would just have to check if the next few characers is an import statement and start to read another file. At the same time, it would have to keep track of the "stack" in *auxil structure, so it knows to which file to return when the current one is parsed.

I don't think support for this should be directly in PackCC, as it only works with stream of characters. It doesn't know anything about files. At best, there could be some function to help with the stack keeping and/or some examples how to implement this.

from packcc.

ccleve avatar ccleve commented on July 17, 2024

@dolik-rce This isn't a suggestion to import data being parsed. It's a suggestion to import specs into the parser itself while the parser is being generated. For example, imagine that we're parsing a query language that must handle standard keywords like AND, OR, and NOT, but must also have special handling for different languages like French or Arabic. In that case it would be really helpful to create a separate .peg file for every language, but then import a standard, common .peg file that recognizes keywords. It would save a lot of copying and pasting.

from packcc.

dolik-rce avatar dolik-rce commented on July 17, 2024

@ccleve Oh, I see. My bad, I guess I wasn't paying enough attention when I read the issue 🙄

from packcc.

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.