2 * Copyright 2006-2014 Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Stephan Aßmus <superstippi@gmx.de>
7 * Rene Gollent <rene@gollent.com>
8 * John Scipione <jscipione@gmail.com>
9 * Ingo Weinhold <bonefish@cs.tu-berlin.de>
11 #ifndef C_LANGUAGE_TOKENIZER
12 #define C_LANGUAGE_TOKENIZER
39 TOKEN_OPENING_SQUARE_BRACKET
,
40 TOKEN_CLOSING_SQUARE_BRACKET
,
42 TOKEN_OPENING_CURLY_BRACE
,
43 TOKEN_CLOSING_CURLY_BRACE
,
72 TOKEN_BEGIN_COMMENT_BLOCK
,
73 TOKEN_END_COMMENT_BLOCK
,
80 class ParseException
{
82 ParseException(const char* message
, int32 position
)
88 ParseException(const ParseException
& other
)
89 : message(other
.message
),
90 position(other
.position
)
101 Token(const Token
& other
);
102 Token(const char* string
, int32 length
,
103 int32 position
, int32 type
);
104 Token
& operator=(const Token
& other
);
117 void SetTo(const char* string
);
119 const Token
& NextToken();
122 bool _ParseOperator();
125 static bool _IsHexDigit(char c
);
127 Token
& _ParseHexOperand();
128 int32
_CurrentPos() const;
132 const char* fCurrentChar
;
138 } // namespace CLanguage
141 #endif // C_LANGUAGE_TOKENIZER