{"id":24021082,"url":"https://github.com/zipcodecore/lexluthor","last_synced_at":"2025-10-25T07:53:18.757Z","repository":{"id":222679143,"uuid":"758053125","full_name":"ZipCodeCore/LexLuthor","owner":"ZipCodeCore","description":"a lever (and a project for regex)","archived":false,"fork":false,"pushed_at":"2025-04-20T20:22:25.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-07T12:47:17.736Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZipCodeCore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-15T14:32:46.000Z","updated_at":"2025-04-20T20:22:28.000Z","dependencies_parsed_at":"2024-02-15T16:45:57.991Z","dependency_job_id":"b59ef18e-3ad4-4796-9c5f-284c27360cf3","html_url":"https://github.com/ZipCodeCore/LexLuthor","commit_stats":null,"previous_names":["zipcodecore/lexluthor"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/ZipCodeCore/LexLuthor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FLexLuthor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FLexLuthor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FLexLuthor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FLexLuthor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZipCodeCore","download_url":"https://codeload.github.com/ZipCodeCore/LexLuthor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FLexLuthor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280923470,"owners_count":26414234,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-01-08T12:38:34.275Z","updated_at":"2025-10-25T07:53:18.727Z","avatar_url":"https://github.com/ZipCodeCore.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LexLuthor\n\na lexer (and a project for regex?)\n\n_remember: the coder who has a problem, and decides to solve it with regex, now has TWO problems._\n\nBuild a `Lexer` class that can read an input String, and produces an ArrayList of `Token`.\n\nA __Lexer__, short for _Lexical Analyzer_, is a program that transforms a sequence of \ncharacters (like source code or HTML) into a sequence of tokens. \nThese tokens are meaningful character strings, such as identifiers, keywords, literals, and operator symbols.\n\nThe process of lexical analysis involves scanning the input for patterns that match the grammar \nfor a programming language and categorizing them as the appropriate token types.\n\nTokens are then processed further by a range of tools, even _compilers_.\n\nThe class `LexLuthor` should load the testdata files and `lex()` each one \nusing the `Lexer` class which implements `LexerIdea`.\n\n```java\ninterface LexerIdea {\n    void setTextBuffer(String buffer);\n    int getCurrentOffset();\n    int getCurrentLineNumber();\n    Token getNextToken();\n}\n```\n\nThe test data is simple HTML in `testdata/`.\nThere a handful of different test data files of increasing complexity.\nScan each file, creating tokens as you go.\nTokens need to be one of the six enumerated types.\nThe tags (keywords) you need to be able to validate are:\n\n- html\n- head\n- body\n- p\n- div\n- strong\n- em\n- ul\n- li\n\nThe output should be a nicely formatted list of the token arraylist. (With the text from inside the tags as well).\n\n### Trees\n\nExtra credit, put it into a Tree. \nThink about it, an HTML file is like a tree, the tags are nested.\nThe `html` tag has `head` and `body` in it, and `body` has a number of even deeper nested tags.\nA Tree is a great data structure to record all this structure into.\n(_Yes, Great Question, the JavaScript DOM is a Tree!_)\n\nNow, from text (HTML) file input to a tree.\nWell, you first need to scan (lex) the input HTML (text) into an array list of tokens.\nThen you need to loop thru the token list and create a tree from the token list.\n\nHow do you know when you create a child? well, if you have seen an `html` open tag, and the next teg is not a\nclose tag `\\html`, then it's a child tag of `html`.\nDoes it feel recursive? yes, it can be.\n\n(Wait, what, Extra-credit? No, there is not such thing is there. Do it now, or do it in the next lab.)\nHere is a pseudo-code-tree, just for you!\n\n```java\nclass Tree\n    Node data\n    ArrayList\u003cNode\u003e children\n\n    Tree()\n\n    - addNode(parent, node)\n            \n    - traverseInOrder(node)\n    // would do something like:\n\n    // if node is not null\n    //    traverseInOrder(node.left)\n    //    print(\" \" + node.value)\n    //    traverseInOrder(node.right)\n\n    // If we call this method, the console output will show the in-order traversal\n```\n\nWhy into a Tree? Well, aren't you the __curious__ pseudo-Zipcoder.\n\nHmm. What's this, there are [Notes](notes.md)?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Flexluthor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzipcodecore%2Flexluthor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Flexluthor/lists"}