Re: Designing a Domain-specific language

dror.openu@gmail.com
Thu, 25 May 2017 12:51:17 -0700 (PDT)

          From comp.compilers

Related articles
Designing a Domain-specific language dror.openu@gmail.com (2017-05-23)
Re: Designing a Domain-specific language bc@freeuk.com (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 laguest9000@googlemail.com (lucretia9@lycos.co.uk) (2017-05-24)
Re: Designing a Domain-specific language dror.openu@gmail.com (2017-05-25)
Re: Designing a Domain-specific language bc@freeuk.com (bartc) (2017-05-27)
| List of all articles for this month |
From: dror.openu@gmail.com
Newsgroups: comp.compilers
Date: Thu, 25 May 2017 12:51:17 -0700 (PDT)
Organization: Compilers Central
References: 17-05-007 17-05-008
Injection-Info: miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="6942"; mail-complaints-to="abuse@iecc.com"
Keywords: design
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, 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?


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.


Thanks


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.