How to handle parsing all-at-once compiling language (Language Module)
roland at rptd.ch
Sun Dec 16 09:16:07 GMT 2018
My problem is that my scripting language works in a way that multiple
scripts compose what I call a "package" in the language. A project is
typically once package. Compiling the package parses and validates all
files in the package without the need for include or import statements.
This gives me troubles in KDevelop. When I parse a file with ParseJob
then I can add imports so the context resolver knows where to find
imports not found in the current script. But in KDevelop I can not add
imports for contexts that are not loaded yet.
Let's say I have a package with three script files A, B and C. Because
this is a package A requires B and C as import, B requires A and C as
import and C requires A and B as import. If I try to force imported
files to be loaded before allowing the current script file to be parsed
I end up in a dead-loop. It is fully allowed A contains a class
depending on a class in C while at the same time C has a class depending
on a class in A. How can I solve this problem in KDevelop?
In my language this works since first all script files in a package are
parsed and the AST build. Then in a second turn the AST is resolved and
the byte code produced. Since at this time the entire AST has been build
from all script files in the package the compiling can resolve
everything properly. But in KDevelop I do not see a possibility for such
a two-stage approach with ParseJob build the way it is. Any help?
Mit freundlichen Grüssen
Leader und Head Programmer
- Game: Epsylon ( http://www.indiedb.com/games/epsylon )
- Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine
, http://dragengine.rptd.ch/wiki )
- Sowie verschiedene Blender Export-Skripts und Game-Tools
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 195 bytes
Desc: OpenPGP digital signature
More information about the KDevelop-devel