Cross referencing from DSL to Other language(eg, .C,Cpp,.py) #890
-
Hello Team I have an usecase in my DSL, where I have to map/reference a variable/function from languages like Python,C,CPP(.py,.c,.cc,.cpp,.h,.hpp). Is it possible ? what would be your recommendation ? MfG |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That likely requires a lot of effort, as you'd need a parser for Python/C++ and integrate it into your DSL language server. My recommendation: declare the variable/function in your DSL and generate Python/C/C++ files declaring the variable/function in those languages (e.g. C/C++ header file). Then you can reference the symbols both in the DSL and in the target languages without the need to parse each other's code. |
Beta Was this translation helpful? Give feedback.
That likely requires a lot of effort, as you'd need a parser for Python/C++ and integrate it into your DSL language server.
My recommendation: declare the variable/function in your DSL and generate Python/C/C++ files declaring the variable/function in those languages (e.g. C/C++ header file). Then you can reference the symbols both in the DSL and in the target languages without the need to parse each other's code.