Reviewed by Eric Seidel.
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2007 06:54:09 +0000 (06:54 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2007 06:54:09 +0000 (06:54 +0000)
commit484648a5c08eaf0f8a9447651f339921797f30d6
tree51c332efbcb220338f74b1601247da59e97305d8
parentf58afa4888241afcddd78e9b6d3799257cfe385a
    Reviewed by Eric Seidel.

        Another round of grammar / parsing cleanup.

        1. Created distinct parser calls for parsing function bodies vs
        programs. This will help later with optimizing global variable access.

        2. Turned Parser into a singleton. Cleaned up Lexer's singleton
        interface.

        3. Modified Lexer to free a little more memory when done lexing. (Added
        FIXMEs for similar issues that I didn't fix.)

        4. Changed Lexer::makeIdentifier and Lexer::makeUString to start
        respecting the arguments passed to them. (No behavior change, but this
        problem could have caused serious problems for an unsuspecting user of
        these functions.)

        5. Removed KJS_DEBUG_MEM because it was bit-rotted.

        6. Removed Parser::prettyPrint because the same work was simpler to do
        at the call site.

        7. Some renames:

            "Parser::accept" => "Parser::didFinishParsing"
            "Parser::sid" => "Parser::m_sourceID"
            "Lexer::doneParsing" => "Lexer::clear"
            "sid" => "sourceId"
            "lineno" => "lineNo"

        * JavaScriptCore.exp:
        * kjs/Parser.cpp:
        (KJS::Parser::Parser):
        (KJS::Parser::parseProgram):
        (KJS::Parser::parseFunctionBody):
        (KJS::Parser::parse):
        (KJS::Parser::didFinishParsing):
        (KJS::parser):
        * kjs/Parser.h:
        (KJS::Parser::sourceId):
        * kjs/function.cpp:
        (KJS::GlobalFuncImp::callAsFunction):
        * kjs/function_object.cpp:
        (FunctionObjectImp::construct):
        * kjs/grammar.y:
        * kjs/interpreter.cpp:
        (KJS::Interpreter::checkSyntax):
        (KJS::Interpreter::evaluate):
        * kjs/interpreter.h:
        * kjs/lexer.cpp:
        (kjsyylex):
        (KJS::lexer):
        (KJS::Lexer::Lexer):
        (KJS::Lexer::~Lexer):
        (KJS::Lexer::scanRegExp):
        (KJS::Lexer::doneParsing):
        (KJS::Lexer::makeIdentifier):
        (KJS::Lexer::makeUString):
        * kjs/lexer.h:
        (KJS::Lexer::pattern):
        (KJS::Lexer::flags):
        (KJS::Lexer::sawError):
        * kjs/nodes.cpp:
        (KJS::Node::Node):
        (KJS::FunctionBodyNode::FunctionBodyNode):
        * kjs/nodes.h:
        * kjs/testkjs.cpp:
        (prettyPrintScript):
        (kjsmain):
        * kjs/ustring.cpp:
        * kjs/ustring.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27842 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.exp
JavaScriptCore/kjs/Parser.cpp
JavaScriptCore/kjs/Parser.h
JavaScriptCore/kjs/function.cpp
JavaScriptCore/kjs/function_object.cpp
JavaScriptCore/kjs/grammar.y
JavaScriptCore/kjs/interpreter.cpp
JavaScriptCore/kjs/interpreter.h
JavaScriptCore/kjs/lexer.cpp
JavaScriptCore/kjs/lexer.h
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/nodes.h
JavaScriptCore/kjs/testkjs.cpp
JavaScriptCore/kjs/ustring.cpp
JavaScriptCore/kjs/ustring.h