Context and transformers work

I thought it'd be nice to discuss on code, so here's a pull request. This a work in progress.

What I'm hoping to do is to implement part 1.1 described here: https://github.com/kframework/k/wiki/Design-of-the-new-compiler-parser

I'll occasionally ping people to get some reviews/feedback.
Yes, sorry, that is what I am saying. I may have miscommunicated if you got
that impression. I think what I probably meant for you to understand is
that all changes to the visitor infrastructure should happen so that they
do not require significant increase in the complexity of BasicVisitor,
AbstractTransformer, CopyOnWriteTransformer, etc.

On Mon, Oct 27, 2014 at 9:32 AM, Ömer Sinan Ağacan <notifications@github.com
> wrote:

> In k-core/src/main/java/org/kframework/parser/DefinitionLoader.java:
>
> > @@ -301,7 +301,7 @@ public Definition parseDefinition(File mainFile, String mainModule, Context cont
> >              // the objects in the sentences are mutable, and we risk altering them and miss
> >              // warning and error messages when kompiling next time around
> >              try {
> > -                def = (Definition) new DisambiguateRulesFilter(context, true).visitNode(def);
> > +                def = (Definition) new DisambiguateRulesFilter(context, def, true).visitNode(def);
>
>  The whole point was that the currentDefinition and currentModule fields
> would get updated automatically in AbstractVisitor whenever they are
> visited.
>
> I think the only way to do that is by setting the field(instead of
> creating a new visitor with the field is set) in AbstractVisitor. Do you
> want me to do that?
>
> (I'm asking because I thought we don't want to change any state of
> abstract visitor classes)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/kframework/k/pull/1100/files#r19407970>.
>