V8 Project
v8::internal::DateParser::BASE_EMBEDDED< Char > Class Template Reference
+ Collaboration diagram for v8::internal::DateParser::BASE_EMBEDDED< Char >:

Public Member Functions

 InputReader (UnicodeCache *unicode_cache, Vector< Char > s)
 
int position ()
 
void Next ()
 
int ReadUnsignedNumeral ()
 
int ReadWord (uint32_t *prefix, int prefix_size)
 
bool Skip (uint32_t c)
 
bool SkipWhiteSpace ()
 
bool SkipParentheses ()
 
bool Is (uint32_t c) const
 
bool IsEnd () const
 
bool IsAsciiDigit () const
 
bool IsAsciiAlphaOrAbove () const
 
bool IsAsciiSign () const
 
int GetAsciiSignValue () const
 
 TimeZoneComposer ()
 
void Set (int offset_in_hours)
 
void SetSign (int sign)
 
void SetAbsoluteHour (int hour)
 
void SetAbsoluteMinute (int minute)
 
bool IsExpecting (int n) const
 
bool IsUTC () const
 
bool Write (FixedArray *output)
 
bool IsEmpty ()
 
 TimeComposer ()
 
bool IsEmpty () const
 
bool IsExpecting (int n) const
 
bool Add (int n)
 
bool AddFinal (int n)
 
void SetHourOffset (int n)
 
bool Write (FixedArray *output)
 
 DayComposer ()
 
bool IsEmpty () const
 
bool Add (int n)
 
void SetNamedMonth (int n)
 
bool Write (FixedArray *output)
 
void set_iso_date ()
 

Static Public Member Functions

static bool IsMinute (int x)
 
static bool IsHour (int x)
 
static bool IsSecond (int x)
 
static bool IsMonth (int x)
 
static bool IsDay (int x)
 

Static Private Member Functions

static bool IsHour12 (int x)
 
static bool IsMillisecond (int x)
 

Private Attributes

int index_
 
Vector< Char > buffer_
 
uint32_t ch_
 
UnicodeCacheunicode_cache_
 
int sign_
 
int hour_
 
int minute_
 
int comp_ [kSize]
 
int hour_offset_
 
int named_month_
 
bool is_iso_date_
 

Static Private Attributes

static const int kSize = 4
 

Detailed Description

template<typename Char>
class v8::internal::DateParser::BASE_EMBEDDED< Char >

Definition at line 49 of file dateparser.h.

Member Function Documentation

◆ Add() [1/2]

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::Add ( int  n)
inline

Definition at line 318 of file dateparser.h.

318  {
319  return index_ < kSize ? (comp_[index_++] = n, true) : false;
320  }

◆ Add() [2/2]

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::Add ( int  n)
inline

Definition at line 347 of file dateparser.h.

347  {
348  if (index_ < kSize) {
349  comp_[index_] = n;
350  index_++;
351  return true;
352  }
353  return false;
354  }

◆ AddFinal()

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::AddFinal ( int  n)
inline

Definition at line 321 of file dateparser.h.

321  {
322  if (!Add(n)) return false;
323  while (index_ < kSize) comp_[index_++] = 0;
324  return true;
325  }

◆ DayComposer()

template<typename Char >
v8::internal::DateParser::BASE_EMBEDDED< Char >::DayComposer ( )
inline

◆ GetAsciiSignValue()

template<typename Char >
int v8::internal::DateParser::BASE_EMBEDDED< Char >::GetAsciiSignValue ( ) const
inline

Definition at line 128 of file dateparser.h.

128 { return 44 - static_cast<int>(ch_); }

◆ InputReader()

template<typename Char >
v8::internal::DateParser::BASE_EMBEDDED< Char >::InputReader ( UnicodeCache unicode_cache,
Vector< Char >  s 
)
inline

Definition at line 51 of file dateparser.h.

52  : index_(0),
53  buffer_(s),
54  unicode_cache_(unicode_cache) {
55  Next();
56  }

◆ Is()

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::Is ( uint32_t  c) const
inline

Definition at line 121 of file dateparser.h.

121 { return ch_ == c; }

◆ IsAsciiAlphaOrAbove()

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsAsciiAlphaOrAbove ( ) const
inline

Definition at line 124 of file dateparser.h.

124 { return ch_ >= 'A'; }

◆ IsAsciiDigit()

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsAsciiDigit ( ) const
inline

Definition at line 123 of file dateparser.h.

123 { return IsDecimalDigit(ch_); }
bool IsDecimalDigit(uc32 c)

References v8::internal::IsDecimalDigit().

+ Here is the call graph for this function:

◆ IsAsciiSign()

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsAsciiSign ( ) const
inline

Definition at line 125 of file dateparser.h.

125 { return ch_ == '+' || ch_ == '-'; }

◆ IsDay()

template<typename Char >
static bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsDay ( int  x)
inlinestatic

Definition at line 359 of file dateparser.h.

359 { return Between(x, 1, 31); }
static bool Between(int x, int lo, int hi)
Definition: dateparser.h:36

References v8::internal::DateParser::Between().

+ Here is the call graph for this function:

◆ IsEmpty() [1/3]

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsEmpty ( )
inline

Definition at line 302 of file dateparser.h.

References v8::internal::DateParser::kNone.

◆ IsEmpty() [2/3]

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsEmpty ( ) const
inline

Definition at line 312 of file dateparser.h.

312 { return index_ == 0; }

◆ IsEmpty() [3/3]

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsEmpty ( ) const
inline

Definition at line 346 of file dateparser.h.

346 { return index_ == 0; }

◆ IsEnd()

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsEnd ( ) const
inline

Definition at line 122 of file dateparser.h.

122 { return ch_ == 0; }

◆ IsExpecting() [1/2]

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsExpecting ( int  n) const
inline

Definition at line 297 of file dateparser.h.

297  {
298  return hour_ != kNone && minute_ == kNone && TimeComposer::IsMinute(n);
299  }

References v8::internal::DateParser::kNone.

◆ IsExpecting() [2/2]

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsExpecting ( int  n) const
inline

Definition at line 313 of file dateparser.h.

313  {
314  return (index_ == 1 && IsMinute(n)) ||
315  (index_ == 2 && IsSecond(n)) ||
316  (index_ == 3 && IsMillisecond(n));
317  }

◆ IsHour()

template<typename Char >
static bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsHour ( int  x)
inlinestatic

Definition at line 330 of file dateparser.h.

330 { return Between(x, 0, 23); }

References v8::internal::DateParser::Between().

+ Here is the call graph for this function:

◆ IsHour12()

template<typename Char >
static bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsHour12 ( int  x)
inlinestaticprivate

Definition at line 334 of file dateparser.h.

334 { return Between(x, 0, 12); }

References v8::internal::DateParser::Between().

+ Here is the call graph for this function:

◆ IsMillisecond()

template<typename Char >
static bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsMillisecond ( int  x)
inlinestaticprivate

Definition at line 335 of file dateparser.h.

335 { return Between(x, 0, 999); }

References v8::internal::DateParser::Between().

+ Here is the call graph for this function:

◆ IsMinute()

template<typename Char >
static bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsMinute ( int  x)
inlinestatic

Definition at line 329 of file dateparser.h.

329 { return Between(x, 0, 59); }

References v8::internal::DateParser::Between().

+ Here is the call graph for this function:

◆ IsMonth()

template<typename Char >
static bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsMonth ( int  x)
inlinestatic

Definition at line 358 of file dateparser.h.

358 { return Between(x, 1, 12); }

References v8::internal::DateParser::Between().

+ Here is the call graph for this function:

◆ IsSecond()

template<typename Char >
static bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsSecond ( int  x)
inlinestatic

Definition at line 331 of file dateparser.h.

331 { return Between(x, 0, 59); }

References v8::internal::DateParser::Between().

+ Here is the call graph for this function:

◆ IsUTC()

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::IsUTC ( ) const
inline

Definition at line 300 of file dateparser.h.

300 { return hour_ == 0 && minute_ == 0; }

◆ Next()

template<typename Char >
void v8::internal::DateParser::BASE_EMBEDDED< Char >::Next ( )
inline

Definition at line 61 of file dateparser.h.

61  {
62  ch_ = (index_ < buffer_.length()) ? buffer_[index_] : 0;
63  index_++;
64  }
int length() const
Definition: vector.h:41

◆ position()

template<typename Char >
int v8::internal::DateParser::BASE_EMBEDDED< Char >::position ( )
inline

Definition at line 58 of file dateparser.h.

58 { return index_; }

◆ ReadUnsignedNumeral()

template<typename Char >
int v8::internal::DateParser::BASE_EMBEDDED< Char >::ReadUnsignedNumeral ( )
inline

Definition at line 69 of file dateparser.h.

69  {
70  int n = 0;
71  int i = 0;
72  while (IsAsciiDigit()) {
73  if (i < kMaxSignificantDigits) n = n * 10 + ch_ - '0';
74  i++;
75  Next();
76  }
77  return n;
78  }
static const int kMaxSignificantDigits
Definition: dateparser.h:45

References v8::internal::DateParser::kMaxSignificantDigits.

◆ ReadWord()

template<typename Char >
int v8::internal::DateParser::BASE_EMBEDDED< Char >::ReadWord ( uint32_t prefix,
int  prefix_size 
)
inline

Definition at line 83 of file dateparser.h.

83  {
84  int len;
85  for (len = 0; IsAsciiAlphaOrAbove(); Next(), len++) {
86  if (len < prefix_size) prefix[len] = AsciiAlphaToLower(ch_);
87  }
88  for (int i = len; i < prefix_size; i++) prefix[i] = 0;
89  return len;
90  }
int AsciiAlphaToLower(uc32 c)

References v8::internal::AsciiAlphaToLower().

+ Here is the call graph for this function:

◆ Set()

template<typename Char >
void v8::internal::DateParser::BASE_EMBEDDED< Char >::Set ( int  offset_in_hours)
inline

Definition at line 289 of file dateparser.h.

289  {
290  sign_ = offset_in_hours < 0 ? -1 : 1;
291  hour_ = offset_in_hours * sign_;
292  minute_ = 0;
293  }

◆ set_iso_date()

template<typename Char >
void v8::internal::DateParser::BASE_EMBEDDED< Char >::set_iso_date ( )
inline

Definition at line 357 of file dateparser.h.

357 { is_iso_date_ = true; }

◆ SetAbsoluteHour()

template<typename Char >
void v8::internal::DateParser::BASE_EMBEDDED< Char >::SetAbsoluteHour ( int  hour)
inline

Definition at line 295 of file dateparser.h.

295 { hour_ = hour; }

◆ SetAbsoluteMinute()

template<typename Char >
void v8::internal::DateParser::BASE_EMBEDDED< Char >::SetAbsoluteMinute ( int  minute)
inline

Definition at line 296 of file dateparser.h.

296 { minute_ = minute; }

◆ SetHourOffset()

template<typename Char >
void v8::internal::DateParser::BASE_EMBEDDED< Char >::SetHourOffset ( int  n)
inline

Definition at line 326 of file dateparser.h.

◆ SetNamedMonth()

template<typename Char >
void v8::internal::DateParser::BASE_EMBEDDED< Char >::SetNamedMonth ( int  n)
inline

Definition at line 355 of file dateparser.h.

355 { named_month_ = n; }

◆ SetSign()

template<typename Char >
void v8::internal::DateParser::BASE_EMBEDDED< Char >::SetSign ( int  sign)
inline

Definition at line 294 of file dateparser.h.

294 { sign_ = sign < 0 ? -1 : 1; }

References v8::internal::sign.

◆ Skip()

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::Skip ( uint32_t  c)
inline

Definition at line 93 of file dateparser.h.

93  {
94  if (ch_ == c) {
95  Next();
96  return true;
97  }
98  return false;
99  }

◆ SkipParentheses()

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::SkipParentheses ( )
inline

Definition at line 109 of file dateparser.h.

109  {
110  if (ch_ != '(') return false;
111  int balance = 0;
112  do {
113  if (ch_ == ')') --balance;
114  else if (ch_ == '(') ++balance;
115  Next();
116  } while (balance > 0 && ch_);
117  return true;
118  }

◆ SkipWhiteSpace()

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::SkipWhiteSpace ( )
inline

Definition at line 101 of file dateparser.h.

101  {
103  Next();
104  return true;
105  }
106  return false;
107  }
bool IsWhiteSpaceOrLineTerminator(unibrow::uchar c)
Definition: scanner.h:124

◆ TimeComposer()

template<typename Char >
v8::internal::DateParser::BASE_EMBEDDED< Char >::TimeComposer ( )
inline

Definition at line 311 of file dateparser.h.

311 : index_(0), hour_offset_(kNone) {}

◆ TimeZoneComposer()

template<typename Char >
v8::internal::DateParser::BASE_EMBEDDED< Char >::TimeZoneComposer ( )
inline

Definition at line 288 of file dateparser.h.

◆ Write() [1/3]

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::Write ( FixedArray output)

◆ Write() [2/3]

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::Write ( FixedArray output)

◆ Write() [3/3]

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::Write ( FixedArray output)

Member Data Documentation

◆ buffer_

template<typename Char >
Vector<Char> v8::internal::DateParser::BASE_EMBEDDED< Char >::buffer_
private

Definition at line 132 of file dateparser.h.

◆ ch_

template<typename Char >
uint32_t v8::internal::DateParser::BASE_EMBEDDED< Char >::ch_
private

Definition at line 133 of file dateparser.h.

◆ comp_

template<typename Char >
int v8::internal::DateParser::BASE_EMBEDDED< Char >::comp_
private

Definition at line 338 of file dateparser.h.

◆ hour_

template<typename Char >
int v8::internal::DateParser::BASE_EMBEDDED< Char >::hour_
private

Definition at line 305 of file dateparser.h.

◆ hour_offset_

template<typename Char >
int v8::internal::DateParser::BASE_EMBEDDED< Char >::hour_offset_
private

Definition at line 340 of file dateparser.h.

◆ index_

template<typename Char >
int v8::internal::DateParser::BASE_EMBEDDED< Char >::index_
private

Definition at line 131 of file dateparser.h.

◆ is_iso_date_

template<typename Char >
bool v8::internal::DateParser::BASE_EMBEDDED< Char >::is_iso_date_
private

Definition at line 367 of file dateparser.h.

◆ kSize

template<typename Char >
static const int v8::internal::DateParser::BASE_EMBEDDED< Char >::kSize = 4
staticprivate

Definition at line 337 of file dateparser.h.

◆ minute_

template<typename Char >
int v8::internal::DateParser::BASE_EMBEDDED< Char >::minute_
private

Definition at line 306 of file dateparser.h.

◆ named_month_

template<typename Char >
int v8::internal::DateParser::BASE_EMBEDDED< Char >::named_month_
private

Definition at line 365 of file dateparser.h.

◆ sign_

template<typename Char >
int v8::internal::DateParser::BASE_EMBEDDED< Char >::sign_
private

Definition at line 304 of file dateparser.h.

◆ unicode_cache_

template<typename Char >
UnicodeCache* v8::internal::DateParser::BASE_EMBEDDED< Char >::unicode_cache_
private

Definition at line 134 of file dateparser.h.


The documentation for this class was generated from the following file: