Loading repository data…
Loading repository data…
yunwei37 / repository
Write a tiny interpreter by C language in 500+ lines
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
tryC is a very simple interpreter made by hand in C language, about 570 lines:
Use recursive descent method for grammatical analysis, do not explicitly build a grammar tree, generate intermediate code or target code; interpret and execute at the same time as grammatical analysis.
The try language implemented by tryC:
Dynamic types, supported data types: double-precision floating-point numbers, character types, strings, arrays of floating-point numbers;functions and variables, recursive call of functions, nested scope;tryC是一个用c语言手搓的非常简单的解释器,大约570行:
采用递归下降法进行语法分析,不显式构建语法树,不生成中间代码或目标代码,在语法分析的同时进行解释执行;
tryC实现的try语言:
source:tryC.c
example:test.try
build:
gcc -o tryc tryC.c
usage:
tryc [-d] filename
用c语言手搓一个600行的类c语言解释器: 给编程初学者的解释器教程(1)- 目标和前言
用c语言手搓一个600行的类c语言解释器: 给编程初学者的解释器教程(2)- 简介和设计
用c语言手搓一个600行的类c语言解释器: 给编程初学者的解释器教程(3)- 词法分析
用c语言手搓一个600行的类c语言解释器: 给编程初学者的解释器教程(4)- 语法分析1:EBNF和递归下降文法