Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2916153
lexer.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
lexer.h
View Options
#ifndef SILVER_LEXER_H
#define SILVER_LEXER_H
#include
<stdbool.h>
#include
"types.h"
typedef
struct
{
jsoff_t
pos
;
jsoff_t
toff
;
jsoff_t
tlen
;
jsval_t
tval
;
uint8_t
tok
;
uint8_t
consumed
;
bool
had_newline
;
}
sv_lexer_state_t
;
typedef
struct
{
ant_t
*
js
;
const
char
*
code
;
jsoff_t
clen
;
bool
strict
;
sv_lexer_state_t
st
;
}
sv_lexer_t
;
typedef
struct
{
const
char
*
str
;
uint32_t
len
;
bool
ok
;
}
sv_lex_string_t
;
typedef
struct
{
const
char
*
code
;
jsoff_t
clen
;
bool
strict
;
sv_lexer_state_t
st
;
}
sv_lexer_checkpoint_t
;
sv_lex_string_t
sv_lexer_str_literal
(
sv_lexer_t
*
lx
);
void
sv_lexer_init
(
sv_lexer_t
*
lx
,
ant_t
*
js
,
const
char
*
code
,
jsoff_t
clen
,
bool
strict
);
void
sv_lexer_set_error_site
(
sv_lexer_t
*
lx
);
void
sv_lexer_save_state
(
const
sv_lexer_t
*
lx
,
sv_lexer_state_t
*
st
);
void
sv_lexer_restore_state
(
sv_lexer_t
*
lx
,
const
sv_lexer_state_t
*
st
);
void
sv_lexer_push_source
(
sv_lexer_t
*
lx
,
sv_lexer_checkpoint_t
*
cp
,
const
char
*
code
,
jsoff_t
clen
);
void
sv_lexer_pop_source
(
sv_lexer_t
*
lx
,
const
sv_lexer_checkpoint_t
*
cp
);
uint8_t
sv_lexer_next
(
sv_lexer_t
*
lx
);
uint8_t
sv_lexer_lookahead
(
sv_lexer_t
*
lx
);
bool
is_space
(
int
c
);
bool
is_digit
(
int
c
);
bool
is_eval_or_arguments_name
(
const
char
*
buf
,
size_t
len
);
bool
is_strict_reserved_name
(
const
char
*
buf
,
size_t
len
);
#endif
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Thu, Mar 26, 4:41 PM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
511887
Default Alt Text
lexer.h (1 KB)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment