Re: .NET Grammar modification





On Nov 29, 7:54 pm, "Jon Slaughter" <Jon_Slaugh...@xxxxxxxxxxx> wrote:
I'm curious as to if .NET provides any direct means to modifying its own
grammar? e.g., if say I want to had some "features" to C# which can easily
be reinterpreted back into the original C# but I do not want to have to
write a full blow parser just to change some simple thing.

Lets suppose want to add a "macro" that on the surface adds the keyword
"property" which in reality is just a shorthand for the standard properties
in C#. I know VS has abilities to do macro's but they are more like "code
inserts" than preprocessing. I want something that is transparent in that it
acts like an extended version of C# but translates directly into it(through
preprocessing).

I know many will say that one shouldn't do this but thats not the point. I
don't want to hack together a quick brute force parser to do some small
conversions but I also don't want to have to implement a full blown parser
to handle a few modifications I want to do.

To be more clear, what I want is some way to preprocess C# files in a
grammatically compatible way to add some small isomorphic features to C#.
The method will simply generate a cs file that will be treated in the normal
way. (Although there is the problem of error handling but its not that big a
deal at this point)

Thanks,
Jon

It's called syntax and common lisp is known for the possibility of
modification and even writing itself.

.



Relevant Pages

  • .NET Grammar modification
    ... write a full blow parser just to change some simple thing. ... inserts" than preprocessing. ... grammatically compatible way to add some small isomorphic features to C#. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: .NET Grammar modification
    ... write a full blow parser just to change some simple thing. ... inserts" than preprocessing. ... grammatically compatible way to add some small isomorphic features to C#. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is pyparsing really a recursive descent parser?
    ... There are an enormous variety of parsing tools, ... For instance, the Earley parser ... Okay, in some contexts, an ambiguous grammar may be considered ... over the other through the context of the parse results? ...
    (comp.lang.python)
  • Re: ANTLR Target for Ruby
    ... is to figure out where backtracking might be needed and do it efficiently ... a large overhead over using a hand-crafted parser. ... If you also provided a sweet metagrammar (I find your earlier Grammar ... The real work is in the "engine" that does parser ...
    (comp.lang.ruby)
  • Re: Desktop Icon Problem
    ... >> Dylan C the upholstery stuffer: ... >>> settings. ... >> It may be, then, that a descriptively adequate grammar is not quite ... >> features is not subject to the strong generative capacity of the ...
    (alt.os.windows-xp)