|Going backwards from a Language(or set of expressions) to a Grammar email@example.com (Seima Rao) (2017-04-16)|
|Re: Going backwards from a Language(or set of expressions) to a Gramma firstname.lastname@example.org (Seima Rao) (2017-04-17)|
|Re: Going backwards from a Language(or set of expressions) to a Gramma email@example.com (Tom) (2017-04-17)|
|Re: Going backwards from a Language(or set of expressions) to a Gramma firstname.lastname@example.org (Alain Ketterlin) (2017-04-17)|
|Re: Going backwards from a Language(or set of expressions) to a Gramma derek@_NOSPAM_knosof.co.uk (Derek M. Jones) (2017-04-17)|
|Date:||Mon, 17 Apr 2017 03:19:30 GMT|
|Organization:||Model Railroaders Unanimous|
|Injection-Info:||miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="11136"; mail-complaints-to="email@example.com"|
|Posted-Date:||17 Apr 2017 09:54:24 EDT|
Seima Rao <firstname.lastname@example.org> wrote in news:email@example.com:
> 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.
Return to the
Search the comp.compilers archives again.