Comments (10)
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.
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.
@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.
@ccleve Oh, I see. My bad, I guess I wasn't paying enough attention when I read the issue
from packcc.
Related Issues (20)
- [Bug] Conflict caused by FALSE, TRUE macros and bool_tag enum using same name HOT 7
- Actions that runs before the end of parsing. HOT 8
- Simple grammar goes into an infinite loop instead of erroring HOT 1
- `$n` should be independent across alternatives HOT 4
- C predicates HOT 2
- Peg only mode? HOT 9
- Parser very slow with repeated parse calls HOT 3
- Lexical state support HOT 5
- Questions not answered in the README HOT 12
- Passing auxil to PCC_DEBUG HOT 3
- AST Mode HOT 11
- Uninitialized variables HOT 8
- value passthrough HOT 4
- parser reads more data than necessary HOT 3
- Strange bad generated parser HOT 5
- Memory usage compared to gcc compiler HOT 13
- raising error from action? HOT 2
- %value and memory management HOT 2
- Consider add support for UCD(Unicode Character Database) rule pattern HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packcc.