检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:刘辉 严碧波[1] LIU hui;YAN Bi-bo(Electronics Information School of Yangtze University,Jingzhou 434023,China)
机构地区:[1]长江大学电子信息学院
出 处:《电脑与信息技术》2019年第5期9-11,15,共4页Computer and Information Technology
摘 要:随着计算机技术的快速发展,越来越多的编程语言出现在了大众的视野中。设计一门新的编程语言,最重要的工作就是实现其对应的编译系统。文章基于LL1文法设计并实现了一款解释器。LL1文法是一种上下文无关的简单文法,使用该文法可以简化解释器的实现过程。解释器主要由前端和后端两大部分组成,前端主要包括词法分析和语法分析,后端主要包括解释执行器和符号表。前端通过词法分析和语法分析将用户的源程序转换成抽象语法树,后端将遍历抽象语法树完成类型检查、符号表的建立以及用户程序的执行。With the rapid development of computer technology,more and more programming languages have appeared in the public's field of vision.To design a new programming language,the most important task is to implement its corresponding compilation system.Therefore,this paper designs and implements an interpreter based on the LL1 grammar.The LL1 grammar is a context-free simple grammar that can be used to simplify the implementation of the interpreter.The interpreter is mainly composed of two parts:the frontend and the backend.The frontend mainly includes lexical analysis and syntax analysis,and the backend mainly includes an explanation executor and a symbol table.The frontend transforms the user's source program into an abstract syntax tree through lexical analysis and parsing.The backend will traverse the abstract syntax tree to complete type checking,symbol table creation,and user program execution.
分 类 号:TP314[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:3.21.113.219