Versions in this module Expand all Collapse all v0 v0.1.0 Sep 3, 2025 Changes in this version + var Keywords = map[string]TokenType + var StateNames = map[LexerState]string + var TokenNames = map[TokenType]string + type Lexer struct + func New(input string) *Lexer + func (l *Lexer) GetErrors() []string + func (l *Lexer) GetRemainingInput() string + func (l *Lexer) NextToken() Token + func (l *Lexer) PeekTokensAhead(n int) []Token + func (l *Lexer) State() LexerState + type LexerState int + const ST_BACKQUOTE + const ST_COMMENT + const ST_DOC_COMMENT + const ST_DOUBLE_QUOTES + const ST_HEREDOC + const ST_INITIAL + const ST_IN_SCRIPTING + const ST_LOOKING_FOR_PROPERTY + const ST_LOOKING_FOR_VARNAME + const ST_NOWDOC + const ST_VAR_OFFSET + func (s LexerState) String() string + type Position struct + Column int + Line int + Offset int + func (p Position) String() string + type StateStack struct + func NewStateStack() *StateStack + func (s *StateStack) Clear() + func (s *StateStack) IsEmpty() bool + func (s *StateStack) Peek() LexerState + func (s *StateStack) Pop() LexerState + func (s *StateStack) Push(state LexerState) + func (s *StateStack) Size() int + type Token struct + Position Position + Type TokenType + Value string + func (t Token) String() string + type TokenType int + const TOKEN_AMPERSAND + const TOKEN_AT + const TOKEN_BACKSLASH + const TOKEN_BACKTICK + const TOKEN_CARET + const TOKEN_COLON + const TOKEN_COMMA + const TOKEN_DIVIDE + const TOKEN_DOLLAR + const TOKEN_DOT + const TOKEN_EQUAL + const TOKEN_EXCLAMATION + const TOKEN_GT + const TOKEN_LBRACE + const TOKEN_LBRACKET + const TOKEN_LPAREN + const TOKEN_LT + const TOKEN_MINUS + const TOKEN_MODULO + const TOKEN_MULTIPLY + const TOKEN_PIPE + const TOKEN_PLUS + const TOKEN_QUESTION + const TOKEN_QUOTE + const TOKEN_RBRACE + const TOKEN_RBRACKET + const TOKEN_RPAREN + const TOKEN_SEMICOLON + const TOKEN_TILDE + const T_ABSTRACT + const T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG + const T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG + const T_AND_EQUAL + const T_ARRAY + const T_ARRAY_CAST + const T_AS + const T_ATTRIBUTE + const T_BAD_CHARACTER + const T_BOOLEAN_AND + const T_BOOLEAN_OR + const T_BOOL_CAST + const T_BREAK + const T_CALLABLE + const T_CASE + const T_CATCH + const T_CLASS + const T_CLASS_C + const T_CLONE + const T_CLOSE_TAG + const T_COALESCE + const T_COALESCE_EQUAL + const T_COMMENT + const T_CONCAT_EQUAL + const T_CONST + const T_CONSTANT_ENCAPSED_STRING + const T_CONTINUE + const T_CURLY_OPEN + const T_DEC + const T_DECLARE + const T_DEFAULT + const T_DIR + const T_DIV_EQUAL + const T_DNUMBER + const T_DO + const T_DOC_COMMENT + const T_DOLLAR_OPEN_CURLY_BRACES + const T_DOUBLE_ARROW + const T_DOUBLE_CAST + const T_ECHO + const T_ELLIPSIS + const T_ELSE + const T_ELSEIF + const T_EMPTY + const T_ENCAPSED_AND_WHITESPACE + const T_ENDDECLARE + const T_ENDFOR + const T_ENDFOREACH + const T_ENDIF + const T_ENDSWITCH + const T_ENDWHILE + const T_END_HEREDOC + const T_ENUM + const T_EOF + const T_EVAL + const T_EXIT + const T_EXTENDS + const T_FILE + const T_FINAL + const T_FINALLY + const T_FN + const T_FOR + const T_FOREACH + const T_FUNCTION + const T_FUNC_C + const T_GLOBAL + const T_GOTO + const T_HALT_COMPILER + const T_IF + const T_IMPLEMENTS + const T_INC + const T_INCLUDE + const T_INCLUDE_ONCE + const T_INLINE_HTML + const T_INSTANCEOF + const T_INSTEADOF + const T_INTERFACE + const T_INT_CAST + const T_ISSET + const T_IS_EQUAL + const T_IS_GREATER_OR_EQUAL + const T_IS_IDENTICAL + const T_IS_NOT_EQUAL + const T_IS_NOT_IDENTICAL + const T_IS_SMALLER_OR_EQUAL + const T_LINE + const T_LIST + const T_LNUMBER + const T_LOGICAL_AND + const T_LOGICAL_OR + const T_LOGICAL_XOR + const T_MATCH + const T_METHOD_C + const T_MINUS_EQUAL + const T_MOD_EQUAL + const T_MUL_EQUAL + const T_NAMESPACE + const T_NAME_FULLY_QUALIFIED + const T_NAME_QUALIFIED + const T_NAME_RELATIVE + const T_NEW + const T_NS_C + const T_NS_SEPARATOR + const T_NULLSAFE_OBJECT_OPERATOR + const T_NUM_STRING + const T_OBJECT_CAST + const T_OBJECT_OPERATOR + const T_OPEN_TAG + const T_OPEN_TAG_WITH_ECHO + const T_OR_EQUAL + const T_PAAMAYIM_NEKUDOTAYIM + const T_PLUS_EQUAL + const T_POW + const T_POW_EQUAL + const T_PRINT + const T_PRIVATE + const T_PRIVATE_SET + const T_PROPERTY_C + const T_PROTECTED + const T_PROTECTED_SET + const T_PUBLIC + const T_PUBLIC_SET + const T_READONLY + const T_REQUIRE + const T_REQUIRE_ONCE + const T_RETURN + const T_SL + const T_SL_EQUAL + const T_SPACESHIP + const T_SR + const T_SR_EQUAL + const T_START_HEREDOC + const T_STATIC + const T_STRING + const T_STRING_CAST + const T_STRING_VARNAME + const T_SWITCH + const T_THROW + const T_TRAIT + const T_TRAIT_C + const T_TRY + const T_UNSET + const T_UNSET_CAST + const T_USE + const T_VAR + const T_VARIABLE + const T_VOID_CAST + const T_WHILE + const T_WHITESPACE + const T_XOR_EQUAL + const T_YIELD + const T_YIELD_FROM + func IsKeyword(s string) (TokenType, bool) + func (t TokenType) String() string