Reviewers: rossberg,

Message:
rossberg, ptal

Description:
Parser / PreParser unification: Add docs.

R=rossberg
BUG=v8:3126
LOG=N

Please review this at https://codereview.chromium.org/196953004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+17, -1 lines):
  M src/preparser.h


Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 55685a124a249f6cbf8546823ec3070e3818591b..f7cad15ea2f740add019cef01b99b43332f807ae 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -38,7 +38,23 @@
 namespace v8 {
 namespace internal {

-// Common base class shared between parser and pre-parser.
+// Common base class shared between parser and pre-parser. Traits encapsulate
+// the differences between Parser and PreParser:
+
+// - Return types: For example, Parser functions return Expression* and
+// PreParser functions return PreParserExpression.
+
+// - Creating parse tree nodes: Parser generates an AST during the recursive +// descent. PreParser doesn't create a tree. Instead, it passes around minimal +// data objects (PreParserExpression, PreParserIdentifier etc.) which contain
+// just enough data for the upper layer functions. PreParserFactory is
+// responsible for creating these dummy objects. It provides a similar kind of +// interface as AstNodeFactory, so ParserBase doesn't need to care which one is
+// used.
+
+// - Miscellanous other tasks interleaved with the recursive descent. For
+// example, Parser keeps track of which function literals should be marked as
+// pretenured, and PreParser doesn't care.
 template <typename Traits>
 class ParserBase : public Traits {
  public:


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to