{"id":15055838,"url":"https://github.com/felipetomazec/lexical-analyzer","last_synced_at":"2025-04-10T03:53:51.678Z","repository":{"id":125255436,"uuid":"194177783","full_name":"FelipeTomazEC/Lexical-Analyzer","owner":"FelipeTomazEC","description":"A basic Lexical-Analyzer written in Java.","archived":false,"fork":false,"pushed_at":"2023-04-15T19:50:00.000Z","size":209,"stargazers_count":29,"open_issues_count":1,"forks_count":11,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-10T03:53:44.366Z","etag":null,"topics":["compilers","java","javafx","javafx-application","lexical-analysis"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FelipeTomazEC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-27T23:55:59.000Z","updated_at":"2025-01-18T16:28:46.000Z","dependencies_parsed_at":"2023-08-10T20:02:16.185Z","dependency_job_id":null,"html_url":"https://github.com/FelipeTomazEC/Lexical-Analyzer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelipeTomazEC%2FLexical-Analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelipeTomazEC%2FLexical-Analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelipeTomazEC%2FLexical-Analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelipeTomazEC%2FLexical-Analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FelipeTomazEC","download_url":"https://codeload.github.com/FelipeTomazEC/Lexical-Analyzer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248155000,"owners_count":21056542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compilers","java","javafx","javafx-application","lexical-analysis"],"created_at":"2024-09-24T21:46:39.573Z","updated_at":"2025-04-10T03:53:51.669Z","avatar_url":"https://github.com/FelipeTomazEC.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lexical Analyzer\n\nThe task of translating high level code, i.e., programming languages, into\na format that can be understood by a computer - binary code - is the\nmain job of a compiler. Speaking in a simple way, the compiler can be\nsplited in 3 parts:\n- Lexical Analyzer (LA)\n- Syntax Analyzer (SA)\n- Semantic Analyzer (SMA)\n\nThe Lexical Analyzer is responsible for separating the source code into\nlexemes, which are the words that compose the code. After separating all\nlexemes, the LA classifies them using Token classification. **Keywords**,\n**Special Symbols**, **Identifiers** and **Operators**, are examples of\ntokens. Removing white spaces and comments from the compiled code is also a\nrole played by the Lexical Analyzer. The output of this process is a\ntable containing the lexemes and their token classification. Lexical\nerrors as invalid constructions of lexemes, *e.g. '12variableName'*,\n*'na;;me'*, are also captured by the LA.\n\nThis project is an implementation of a **simple** Lexical Analyzer made in Java.\nIt provides a GUI where the user can type the code and get the tokens of it.\nIt is also possible to load the code from a file and make the analysis.\n\n### Recognized Tokens\nThe Lexical Analyzer of this project recognizes the following classes\nof tokens:\n- **IDENTIFIER** - Variable names;\n- **STRING** - Words between double quotes \"\";\n- **INTEGER** - Number with no dot ( . );\n- **FLOAT** - Float point numbers;\n- **PLUS** - ( + );\n- **MINUS** - ( - );\n- **TIMES** - ( * ),\n- **DIVIDE** - ( / );\n- **KEYWORD** - for, while, do, if, else, print, switch, case, default and\n  null;\n- **INVALID**;\n- **ASSIGN_OP** - Assignment operator ( = );\n- **SEMICOLON** - ( ; )\n- **LEFT_PARENTHESIS** - '(';\n- **RIGHT_PARENTHESIS** - ')';\n- **LEFT_BRACE** - ( { );\n- **RIGHT_BRACE** - ( } );\n- **COMMA** - ( , );\n- **DOT** - ( . );\n- **DOTDOT** - ( .. );\n- **COLON** - ( : );\n- **EQUAL** - ( == );\n- **LOWER_OR_EQUALS** - ( \u003c= );\n- **GREATER_OR_EQUALS** - ( \u003e= );\n- **NOT_EQUALS** - ( \u003c\u003e );\n- **GREATER_THAN** - ( \u003e );\n- **LOWER_THAN** - ( \u003c );\n- **AT_SIGN** - ( @ ).\n\n\n***P.S. 1**: Sentences initiated by // or chunks of sentences between /* */\nare considered comments and are not mentioned in the output.*\n\n***P.S. 2**: The lexemes must be separated by at least one white space(' ')\nto be recognized as separated things.*\n\n### Screenshot\n\u003cimg src=\"https://user-images.githubusercontent.com/36672867/76977097-9eef4f00-6913-11ea-886a-8eae70a68ecc.jpeg\" alt=\"drawing\" width=\"600\"/\u003e\n\n### Conclusion\nThis is a very simple example that demonstrates how a Lexical Analyzer\ncan be implemented. This project is also a usage example of\nFinite-State Automata, a very powerful and useful tool.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipetomazec%2Flexical-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelipetomazec%2Flexical-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipetomazec%2Flexical-analyzer/lists"}