Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #1875
| From | bartc <bc@freeuk.com> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: Designing a Domain-specific language |
| Date | 2017-05-23 20:39 +0100 |
| Organization | virginmedia.com |
| Message-ID | <17-05-008@comp.compilers> (permalink) |
| References | <17-05-007@comp.compilers> |
On 23/05/2017 15:12, dror.openu@gmail.com wrote: > I'm implementing right now a "compiler" for a DSL that used at my work, and I'd like to get your advice for a dilemma I have. > One of the requirements at the begging was that the compiler should get an input only one file. > > But, it's changed and I asked to add two more capabilities. and they are: > [ some sort of multiple input file ] This depends on lots of things. Are you taking something that would have been one big file, and simply allowing it to be split? Do the STD common parts, something that would have been part of one file, now have to be part of each of the multiple files? How does each file know about what's in the other files, when it's something not in those STD common included files? One easy solution (assuming having to compile all the sources is not an issue) might be to just load all the files into memory and combine them into one file. Then compile as a single file, dealing with possible multiple includes, or out-of-order references, if that would be a problem. But it really depends on how this language works. (All the compiler projects I do now aim to compile all modules of a project together. Some will have a hierarchical module system and that can help: there is one symbol table, with the whole program as the root, and (as I do it with modules sharing a flat namespace), each source file or module at the next level. Below that, whatever is defined within each module. This however is the symbol table tree, not the parse tree. Individual parse trees exist per function. This is why it depends a great deal on the language.) -- bartc
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Designing a Domain-specific language dror.openu@gmail.com - 2017-05-23 07:12 -0700
Re: Designing a Domain-specific language bartc <bc@freeuk.com> - 2017-05-23 20:39 +0100
Re: Designing a Domain-specific language dror.openu@gmail.com - 2017-05-25 12:51 -0700
Re: Designing a Domain-specific language bartc <bc@freeuk.com> - 2017-05-27 16:00 +0100
Re: Designing a Domain-specific language Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2017-05-24 06:42 +0200
Re: Designing a Domain-specific language "lucretia9@lycos.co.uk" <laguest9000@googlemail.com> - 2017-05-24 04:13 -0700
csiph-web