Update
authorMiguel de Icaza <miguel@gnome.org>
Sun, 25 Sep 2005 18:37:20 +0000 (18:37 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Sun, 25 Sep 2005 18:37:20 +0000 (18:37 -0000)
svn path=/trunk/mcs/; revision=50734

mcs/docs/compiler

index bbdb95031902fe5f78ab8ac37249a0bf7c3bbe89..97663b14f0f12ed383aad09e7f1d6c1433d0c7c6 100755 (executable)
        return either an ArrayAccess expression or an IndexerAccess
        expression from DoResolve.
 
+       All errors must be reported during the resolution phase
+       (DoResolve) and if an error is detected the DoResolve method
+       will return null which is used to flag that an error condition
+       has ocurred, this will be used to stop compilation later on.
+       This means that anyone that calls Expression.Resolve must
+       check the return value for null which would indicate an error
+       condition.
 
+       The second stage that Expressions participate in is code
+       generation, this is done by overwriting the "Emit" method of
+       the Expression class.  No error checking must be performed
+       during this stage.
 
-*** The Expression Class
+** Simple Names, MemberAccess
+
+       One of the most important classes in the compiler is
+       "SimpleName" which represents a simple name (from the C#
+       specification).  The names during the resolution time are
+       bound to field names, parameter names or local variable names.
+
+       More complicated expressions like:
+
+               Math.Sin
+
+       Are composed using the MemberAccess class which contains a
+       name (Math) and a SimpleName (Sin), this helps driving the
+       resolution process.
+
+** Types
+
+       The parser creates expressions to represent types during
+       compilation.  For example:
+
+          class Sample {
+
+               Version vers;
+
+          }
+
+
+       That will produce a "SimpleName" expression for the "Version"
+       word.  And in this particular case, the parser will introduce
+       "Version vers" as a field declaration.
+
+       During the resolution process for the fields, the compiler
+       will have to resolve the word "Version" to a type.  This is
+       done by using the "ResolveAsType" method in Expression instead
+       of using "Resolve".
+
+       ResolveAsType just turns on a different set of code paths for
+       things like SimpleNames and does a different kind of error
+       checking than the one used by regular expressions. 
 
-       The utility functions that can be called by all children of
-       Expression. 
 
 ** Constants