This project is a simple JavaScript Lexer (Lexical Analyzer) built with HTML, CSS, and JavaScript.
It scans the input JavaScript code and breaks it into tokens (small meaningful units).
π In real-world compilers and tools (like VS Code, Babel, TypeScript Compiler), a Lexer is the first phase of the compiler.
It runs before parsing and converts raw source code into tokens which are then used for syntax analysis and highlighting.
- Converts code into tokens such as:
- Keywords (e.g.,
let
,function
) - Identifiers (e.g., variable names)
- Numbers (e.g.,
123
,45.6
) - Strings (e.g.,
"Hello"
) - Operators (e.g.,
+
,==
,=
) - Separators (e.g.,
;
,{
,}
)
- Keywords (e.g.,
- Clear button to reset input and output.
- Very simple and easy-to-use interface.