|Designing a Domain-specific language email@example.com (2017-05-23)|
|Re: Designing a Domain-specific language firstname.lastname@example.org (bartc) (2017-05-23)|
|Re: Designing a Domain-specific language DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2017-05-24)|
|Re: Designing a Domain-specific language email@example.com (firstname.lastname@example.org) (2017-05-24)|
|Re: Designing a Domain-specific language email@example.com (2017-05-25)|
|Re: Designing a Domain-specific language firstname.lastname@example.org (bartc) (2017-05-27)|
|Date:||Thu, 25 May 2017 12:51:17 -0700 (PDT)|
|Injection-Info:||miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="6942"; mail-complaints-to="email@example.com"|
|Posted-Date:||25 May 2017 23:34:38 EDT|
On Thursday, May 25, 2017 at 5:58:28 PM UTC+3, bartc wrote:
> On 23/05/2017 15:12, firstname.lastname@example.org 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?
Yes. this is exactly the case.
The purpose of this language is to configure jobs we have in our system.
(the compiler will convert it to "byte code" that will be executed by the interpreter).
A good example is when you want to share configuration between group of jobs (or want to "inherit" configuration from a job).
You want to be able to create a "base" file, and use it somewhere in the project (I want to parse the "base" file only once, even if it imported multiple times).
> 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.
I prefer to parse each file separately, and only once.
it will also give a good, readable errors (file name + line number.)
I'm kind of newbie in the compilers world. my experience is only the university course.
So I really appreciate your help.
Return to the
Search the comp.compilers archives again.