[Webkit-unassigned] [Bug 34019] Custom-written JavaScript parser

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 5 08:15:39 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=34019





--- Comment #40 from Zoltan Herczeg <zherczeg at webkit.org>  2010-02-05 08:15:31 PST ---
> A way to avoid having two copies of the code and yet still have the
> non-syntax-check version be fast, is to use C++ templates. 

I like this idea. A difference between the syntax checker and he grammar is not
only the simplified code, but also the simplified data structures. Furtunately,
the data structures can also be template arguments.

My question is which is the best way to do it? What about the following:

template<bool syntaxChecker, class StackItem, class MemberVariables>::class
Grammar {};

struct GrammarStackItem { ... };
struct SyntaxCheckerStackItem { ... };

struct SyntaxCheckerMemberVariables { ... };
struct GrammarMemberVariables {
     ...
     Grammar<true, SyntaxCheckerStackItem,
         SyntaxCheckerMemberVariables> checker;
};

I hope the declaration order will be ok in this way.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list