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


Groups > comp.compilers > #1855

Re: Going backwards from a Language(or set of expressions) to a Grammar

Path csiph.com!feeder.erje.net!2.us.feeder.erje.net!feeder.usenetexpress.com!feeder1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From Tom <treid3@centurylink.net>
Newsgroups comp.compilers
Subject Re: Going backwards from a Language(or set of expressions) to a Grammar
Date Mon, 17 Apr 2017 03:19:30 GMT
Organization Model Railroaders Unanimous
Lines 24
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <17-04-016@comp.compilers> (permalink)
References <17-04-014@comp.compilers>
Injection-Info miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="11136"; mail-complaints-to="abuse@iecc.com"
Keywords parse
Posted-Date 17 Apr 2017 09:54:24 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref csiph.com comp.compilers:1855

Show key headers only | View raw


Seima Rao <seimarao@gmail.com> wrote in news:17-04-014@comp.compilers:

> Hi,
>
>     Is it possible generally to arrive at a grammar from
>     a language or set of expressions ?

It depends on the language properties.  It can be simple to impossible.

Your question implied that you thoroughly know the language and wanted
to derive its grammar sufficiently to write a parser/complier to
(correctly) process example programs/expressions.

An experienced compiler writer will need some time to study what
category of grammar is needed. (Regular) expressions just need an
lexical analyzer. Many languages like Pascal and Modula2 are LL-1 and
the grammars and parsers are straightforward recursive descent.  Other
languages like C and its bethren need more complex bottom-up parsers
and preprocessors for disambiguation. Large context sensitive
languages (English for example) have a high error rate.  So, your
answer is yes for simple with some practice and understanding and can
be extrememly had as the language gets complexity.

Elegant

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


Thread

Going backwards from a Language(or set of expressions) to a Grammar Seima Rao <seimarao@gmail.com> - 2017-04-16 19:01 +0530
  Re: Going backwards from a Language(or set of expressions) to a Grammar Seima Rao <seimarao@gmail.com> - 2017-04-17 08:31 +0530
  Re: Going backwards from a Language(or set of expressions) to a Grammar Tom <treid3@centurylink.net> - 2017-04-17 03:19 +0000
  Re: Going backwards from a Language(or set of expressions) to a Grammar Alain Ketterlin <alain@universite-de-strasbourg.fr> - 2017-04-17 12:57 +0200
  Re: Going backwards from a Language(or set of expressions) to a Grammar "Derek M. Jones" <derek@_NOSPAM_knosof.co.uk> - 2017-04-17 15:29 +0100
  Re: Going backwards from a Language(or set of expressions) to a Grammar Stefan Monnier <monnier@iro.umontreal.ca> - 2017-05-06 22:02 -0400

csiph-web