help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some seeming context sensitivity, and shift/reduce errors


From: Hans Aberg
Subject: Re: Some seeming context sensitivity, and shift/reduce errors
Date: Sun, 9 Dec 2007 10:46:48 +0100

On 9 Dec 2007, at 09:50, Jack T Mudge III wrote:

[Please keep the cc to the Help-Bison list, as other may want to join
in.]

I thought it was; must have forgotten it. Apologies, Kontact doesn't
automatically copy the CC line (yet).

Don't know about your mailer, but often there is a special key combination or menu entry "reply all".

One can push the context sensitivities into the actions. This way,
one can even handle language like C++. An alternate approach is to
use the GLR parser (see the manual).

Some way to tell what tokens appeared in a context?

One can tweak the lexer, so that it gives different tokens depending context. A common from of conetxt sensitivity is a definition: before the definition, it is a name, but it has a different syntax afterwards. Then let the lexer look up names in a look-up table, and based on that, return token value to the parser. The parser can then change that. Also check out "start conditions" in the Flex manual.

Look around for some similar languages, which helps avoiding
pitfalls, and may give ideas on grammar design.

The syntax of this language is based mostly on that used by didiwiki. I would perfer something like a simplified TeX, myself, but didiwiki's syntax is
friendly to my mom's ignorance and my dad's need for voice recognition
software. Since DidiWiki seems intent on removing itself from the web, I figured there's no time like the present to replace it (and perhaps improve
upon it, but I'll save that for after replacing it).

The source is all but inaccessible at this point, but I assume the syntax *bold*, /italic/, _underline_, -strike through-, [link], etc. are common
among at least earlier wikis. I guess the source for some other
implementations will be my next stop while I wait.

Perhaps somebody else can give suggestions. TeX has stuff in it, making it hard to treat with a Flex/Bison combination.

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]