ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

regexp.c File Reference
#include <assert.h>
#include <math.h>
#include "jscript.h"
#include "wine/debug.h"

Go to the source code of this file.

Data Structures

struct  RECharSet
struct  JSRegExp
struct  RegExpInstance
struct  RECapture
struct  REMatchState
struct  REProgState
struct  REBackTrackData
struct  REGlobalData
struct  RENode
struct  CompilerState
struct  EmitStateStackEntry
struct  REOpData

Defines

#define JSREG_FOLD   0x01 /* fold uppercase to lowercase */
#define JSREG_GLOB   0x02 /* global exec, creates array of matches */
#define JSREG_MULTILINE   0x04 /* treat ^ and $ as begin and end of line */
#define JSREG_STICKY   0x08 /* only match starting at lastIndex */
#define ReportRegExpError(a, b, c)
#define ReportRegExpErrorHelper(a, b, c, d)
#define JS_ReportErrorNumber(a, b, c, d)
#define JS_ReportErrorFlagsAndNumber(a, b, c, d, e, f)
#define js_ReportOutOfScriptQuota(a)
#define JS_ReportOutOfMemory(a)
#define JS_COUNT_OPERATION(a, b)
#define JSMSG_MIN_TOO_BIG   47
#define JSMSG_MAX_TOO_BIG   48
#define JSMSG_OUT_OF_ORDER   49
#define JSMSG_OUT_OF_MEMORY   137
#define LINE_SEPARATOR   0x2028
#define PARA_SEPARATOR   0x2029
#define RE_IS_LETTER(c)
#define RE_IS_LINE_TERM(c)
#define JS_ISWORD(c)   ((c) < 128 && (isalnum(c) || (c) == '_'))
#define JS7_ISDEC(c)   ((((unsigned)(c)) - '0') <= 9)
#define JS7_UNDEC(c)   ((c) - '0')
#define REOP_IS_SIMPLE(op)   ((op) <= REOP_NCLASS)
#define INITIAL_STATESTACK   100
#define INITIAL_BACKTRACK   8000
#define CLASS_CACHE_SIZE   4
#define ARG_LEN   2
#define GET_ARG(pc)   ((WORD)(((pc)[0] << 8) | (pc)[1]))
#define SET_ARG(pc, arg)
#define OFFSET_LEN   ARG_LEN
#define OFFSET_MAX   ((1 << (ARG_LEN * 8)) - 1)
#define GET_OFFSET(pc)   GET_ARG(pc)
#define TREE_DEPTH_MAX   ((1 << 24) / sizeof(EmitStateStackEntry))
#define CLASS_BITMAPS_MEM_LIMIT   (1 << 24)
#define JUMP_OFFSET_HI(off)   ((jsbytecode)((off) >> 8))
#define JUMP_OFFSET_LO(off)   ((jsbytecode)(off))
#define JSREG_FIND_PAREN_COUNT   0x8000
#define JSREG_FIND_PAREN_ERROR   0x4000
#define OVERFLOW_VALUE   ((UINT)-1)
#define INITIAL_STACK_SIZE   128
#define PUSH_STATE_STACK(data)
#define PREPARE_REPEAT()
#define MIN_BACKTRACK_LIMIT   400000

Typedefs

typedef BYTE JSPackedBool
typedef BYTE jsbytecode

Enumerations

enum  REOp {
  REOP_EMPTY, REOP_BOL, REOP_EOL, REOP_WBDRY,
  REOP_WNONBDRY, REOP_DOT, REOP_DIGIT, REOP_NONDIGIT,
  REOP_ALNUM, REOP_NONALNUM, REOP_SPACE, REOP_NONSPACE,
  REOP_BACKREF, REOP_FLAT, REOP_FLAT1, REOP_FLATi,
  REOP_FLAT1i, REOP_UCFLAT1, REOP_UCFLAT1i, REOP_UCFLAT,
  REOP_UCFLATi, REOP_CLASS, REOP_NCLASS, REOP_ALT,
  REOP_QUANT, REOP_STAR, REOP_PLUS, REOP_OPT,
  REOP_LPAREN, REOP_RPAREN, REOP_JUMP, REOP_DOTSTAR,
  REOP_LPARENNON, REOP_ASSERT, REOP_ASSERT_NOT, REOP_ASSERTTEST,
  REOP_ASSERTNOTTEST, REOP_MINIMALSTAR, REOP_MINIMALPLUS, REOP_MINIMALOPT,
  REOP_MINIMALQUANT, REOP_ENDCHILD, REOP_REPEAT, REOP_MINIMALREPEAT,
  REOP_ALTPREREQ, REOP_ALTPREREQ2, REOP_ENDALT, REOP_CONCAT,
  REOP_END, REOP_LIMIT
}

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (jscript)
static BOOL ParseRegExp (CompilerState *)
static size_t GetCompactIndexWidth (size_t index)
static jsbytecodeWriteCompactIndex (jsbytecode *pc, size_t index)
static jsbytecodeReadCompactIndex (jsbytecode *pc, size_t *result)
static RENodeNewRENode (CompilerState *state, REOp op)
static BOOL isASCIIHexDigit (WCHAR c, UINT *digit)
static BOOL SetForwardJumpOffset (jsbytecode *jump, jsbytecode *target)
static jsbytecodeEmitREBytecode (CompilerState *state, JSRegExp *re, size_t treeDepth, jsbytecode *pc, RENode *t)
static BOOL ProcessOp (CompilerState *state, REOpData *opData, RENode **operandStack, INT operandSP)
static UINT FindParenCount (CompilerState *state)
static UINT GetDecimalValue (WCHAR c, UINT max, UINT(*findMax)(CompilerState *state), CompilerState *state)
static BOOL CalculateBitmapSize (CompilerState *state, RENode *target, const WCHAR *src, const WCHAR *end)
static INT ParseMinMaxQuantifier (CompilerState *state, BOOL ignoreValues)
static BOOL ParseQuantifier (CompilerState *state)
static BOOL ParseTerm (CompilerState *state)
static REBackTrackDataPushBackTrackState (REGlobalData *gData, REOp op, jsbytecode *target, REMatchState *x, const WCHAR *cp, size_t parenIndex, size_t parenCount)
static REMatchStateFlatNIMatcher (REGlobalData *gData, REMatchState *x, WCHAR *matchChars, size_t length)
static REMatchStateBackrefMatcher (REGlobalData *gData, REMatchState *x, size_t parenIndex)
static void AddCharacterToCharSet (RECharSet *cs, WCHAR c)
static void AddCharacterRangeToCharSet (RECharSet *cs, UINT c1, UINT c2)
static BOOL ProcessCharSet (REGlobalData *gData, RECharSet *charSet)
static BOOL ReallocStateStack (REGlobalData *gData)
static REMatchStateSimpleMatch (REGlobalData *gData, REMatchState *x, REOp op, jsbytecode **startpc, BOOL updatecp)
static REMatchStateExecuteREBytecode (REGlobalData *gData, REMatchState *x)
static REMatchStateMatchRegExp (REGlobalData *gData, REMatchState *x)
static REMatchStateInitMatch (script_ctx_t *cx, REGlobalData *gData, JSRegExp *re, size_t length)
static void js_DestroyRegExp (JSRegExp *re)
static JSRegExpjs_NewRegExp (script_ctx_t *cx, BSTR str, UINT flags, BOOL flat)
static RegExpInstanceregexp_from_vdisp (vdisp_t *vdisp)
static void set_last_index (RegExpInstance *This, DWORD last_index)
static HRESULT do_regexp_match_next (script_ctx_t *ctx, RegExpInstance *regexp, DWORD rem_flags, const WCHAR *str, DWORD len, const WCHAR **cp, match_result_t **parens, DWORD *parens_size, DWORD *parens_cnt, match_result_t *ret)
HRESULT regexp_match_next (script_ctx_t *ctx, DispatchEx *dispex, DWORD rem_flags, const WCHAR *str, DWORD len, const WCHAR **cp, match_result_t **parens, DWORD *parens_size, DWORD *parens_cnt, match_result_t *ret)
HRESULT regexp_match (script_ctx_t *ctx, DispatchEx *dispex, const WCHAR *str, DWORD len, BOOL gflag, match_result_t **match_result, DWORD *result_cnt)
static HRESULT RegExp_source (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static HRESULT RegExp_global (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static HRESULT RegExp_ignoreCase (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static HRESULT RegExp_multiline (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static INT index_from_var (script_ctx_t *ctx, VARIANT *v)
static HRESULT RegExp_lastIndex (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static HRESULT RegExp_toString (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static HRESULT create_match_array (script_ctx_t *ctx, BSTR input, const match_result_t *result, const match_result_t *parens, DWORD parens_cnt, jsexcept_t *ei, IDispatch **ret)
static HRESULT run_exec (script_ctx_t *ctx, vdisp_t *jsthis, VARIANT *arg, jsexcept_t *ei, BSTR *input, match_result_t *match, match_result_t **parens, DWORD *parens_cnt, VARIANT_BOOL *ret)
static HRESULT RegExp_exec (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static HRESULT RegExp_test (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static HRESULT RegExp_value (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static void RegExp_destructor (DispatchEx *dispex)
static HRESULT alloc_regexp (script_ctx_t *ctx, DispatchEx *object_prototype, RegExpInstance **ret)
HRESULT create_regexp (script_ctx_t *ctx, const WCHAR *exp, int len, DWORD flags, DispatchEx **ret)
HRESULT create_regexp_var (script_ctx_t *ctx, VARIANT *src_arg, VARIANT *flags_arg, DispatchEx **ret)
HRESULT regexp_string_match (script_ctx_t *ctx, DispatchEx *re, BSTR str, VARIANT *retv, jsexcept_t *ei)
static HRESULT RegExpConstr_leftContext (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static HRESULT RegExpConstr_rightContext (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static HRESULT RegExpConstr_value (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
HRESULT create_regexp_constr (script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret)
HRESULT parse_regexp_flags (const WCHAR *str, DWORD str_len, DWORD *ret)

Variables

static const WCHAR sourceW [] = {'s','o','u','r','c','e',0}
static const WCHAR globalW [] = {'g','l','o','b','a','l',0}
static const WCHAR ignoreCaseW [] = {'i','g','n','o','r','e','C','a','s','e',0}
static const WCHAR multilineW [] = {'m','u','l','t','i','l','i','n','e',0}
static const WCHAR lastIndexW [] = {'l','a','s','t','I','n','d','e','x',0}
static const WCHAR toStringW [] = {'t','o','S','t','r','i','n','g',0}
static const WCHAR execW [] = {'e','x','e','c',0}
static const WCHAR testW [] = {'t','e','s','t',0}
static const WCHAR leftContextW []
static const WCHAR rightContextW []
static const WCHAR undefinedW [] = {'u','n','d','e','f','i','n','e','d',0}
static const WCHAR emptyW [] = {0}
static const charreop_names []
static const builtin_prop_t RegExp_props []
static const builtin_info_t RegExp_info
static const builtin_prop_t RegExpConstr_props []
static const builtin_info_t RegExpConstr_info

Generated on Mon May 28 2012 05:11:18 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.