相关代码 |
|
一、语言规定 程序实现一个语言的词法分析,其中此语言的定义 关键字(类别1): "double","int","struct","break","else","long","switch","case","enum","register","typedef","char","return","const","float","short","continue","for","signed","void","default","goto","do","if","while","static","then" 标识符(类别2):标识符后必须跟空格、')'、'='、','、';'、'>'、' 常数(类别3) 运算符(类别4): + - * / > < = 界符(类别5):;,( ) 二、程序说明: 程序文件Lex.java 程序中的输入文件:file.txt(注意路径正确) 程序中的输出文件:result.txt(二元式) 输入'#'代表程序结束。
相关资源 |
|