Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1880

Re: Designing a Domain-specific language

From dror.openu@gmail.com
Newsgroups comp.compilers
Subject Re: Designing a Domain-specific language
Date 2017-05-25 12:51 -0700
Organization Compilers Central
Message-ID <17-05-013@comp.compilers> (permalink)
References <17-05-007@comp.compilers> <17-05-008@comp.compilers>

Show all headers | View raw


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

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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