Skip to content

BohanSu/Lexical-Analyzer-Lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Lexical Analyzer Lab / 词法分析器实验

Project Description / 项目描述

A lightweight lexical analyzer implemented in Python for tokenizing source code. 一个轻量级的 Python 词法分析器,用于源代码的分词。

This tool reads an input source file, identifies tokens based on predefined lexical rules (such as keywords, identifiers, operators, and delimiters), and outputs the recognized token sequence. 该工具读取输入源文件,根据预定义的词法规则(如关键字、标识符、运算符和分隔符)识别 Token,并输出识别到的 Token 序列。

GitHub Repository Details / GitHub 仓库详情

Repository Name / 仓库名称

Lexical-Analyzer-Lab

Description / 描述

A lightweight lexical analyzer implemented in Python for tokenizing source code. 一个轻量级的 Python 词法分析器,用于源代码的分词。

Topics (Tags) / 标签

compiler-construction, lexical-analysis, lexer, python, tokenization

How to Run / 如何运行

  1. Ensure you have Python installed. 确保你已安装 Python。

  2. Place your test code in input.txt. 将你的测试代码放入 input.txt 文件中。

  3. Run the script: 运行脚本:

    python lexer.py

About

A lightweight lexical analyzer implemented in Python for tokenizing source code. (一个轻量级的 Python 词法分析器,用于源代码的分词。)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages