Changeset 31809 in webkit for trunk/JavaScriptCore/kjs/lexer.h


Ignore:
Timestamp:
Apr 11, 2008, 1:14:45 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Geoff.

Generate a pure (re-entrant) parser with Bison.

No change on SunSpider.

  • kjs/Parser.cpp: (KJS::Parser::parse):
  • kjs/grammar.y:
  • kjs/lexer.cpp: (kjsyylex): (KJS::Lexer::lex):
  • kjs/lexer.h: Pass state as function arguments, instead of global data. Don't call lexer() as often as before, as this function is about to become slower due to thread-specific storage.
  • kjs/function.cpp: (KJS::isStrWhiteSpace): Don't call isSeparatorSpace() for 8-bit characters, as these are already taken care of. This is a small speedup, compensating for a small slowdown caused by switching Bison mode.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/lexer.h

    r29538 r31809  
    2828#include <wtf/Vector.h>
    2929
     30union YYSTYPE;
     31struct YYLTYPE;
     32
    3033namespace KJS {
    3134
     
    3639  public:
    3740    void setCode(int startingLineNumber, const UChar *c, unsigned int len);
    38     int lex();
     41    int lex(YYSTYPE* lvalp, YYLTYPE* llocp);
    3942
    4043    int lineNo() const { return yylineno; }
Note: See TracChangeset for help on using the changeset viewer.