|compiler with non-deterministic grammar email@example.com (Wei-cheng Lai) (1997-05-03)|
|Re: compiler with non-deterministic grammar firstname.lastname@example.org (Scott Stanchfield) (1997-05-08)|
|Re: compiler with non-deterministic grammar eserra@svmp01.Harris.COM (Efren Serra) (1997-05-13)|
|Re: compiler with non-deterministic grammar Sandeep.email@example.com (Sandeep Dutta) (1997-05-15)|
|Re: compiler with non-deterministic grammar firstname.lastname@example.org (1997-05-17)|
|From:||Scott Stanchfield <email@example.com>|
|Date:||8 May 1997 01:04:43 -0400|
Not sure why you want it, but...
You could try a compiler that provides semantic predicates (such as
PCCTS) and make the predicates perform the probability check. For
example (PCCTS 1.33 syntax)
rule: <<rollTheD100() < 50>>? alt1
would execute function rollTheD100() (A 100-sided die...) and test if
the result were less than 50. alt1 would be attempted if:
the semantic test were true (value < 50) AND
the next token were in first(alt1)
otherwise, alt2 would be attempted IF the next token were in first(alt2)
otherwise, syntax error
Is this this type of thing you're looking for?
(I'd be interested in hearing what type of application this type of
parser has... please post something about it if you can...)
Wei-cheng Lai wrote:
> Does anybody know how to construct a compiler with
> non-deterministic grammar? I means that the grammars may contain some
> probability within it. The same sentence might be compiled in
> different way based on some sort of probability. Could you also tell
> me what are good references?
> BTW, is it too wierd to have some kind of adaptive compiler such that
> it can modify its grammar along the way?
Scott Stanchfield Santa Cruz,CA
Visit my PCCTS Tutorial at http://www.scruz.net/~thetick/pcctstut
Return to the
Search the comp.compilers archives again.