2 Star 0 Fork 0

Arthas/BUAA_ADSL

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
lexer.txt 3.51 KB
一键复制 编辑 原始数据 按行查看 历史
罗宇轩 提交于 2023-12-20 19:33 . final
DEFTK def
IDENFR func1
LPARENT (
INTTK int
IDENFR a
COMMA ,
INTTK int
IDENFR b
RPARENT )
ARROW ->
INTTK int
LBRACE {
RETURNTK return
IDENFR a
MULT *
IDENFR b
SEMICN ;
RBRACE }
DEFTK def
IDENFR func2_add
LPARENT (
INTTK int
IDENFR a
COMMA ,
INTTK int
IDENFR b
RPARENT )
ARROW ->
INTTK int
LBRACE {
RETURNTK return
IDENFR a
ADD +
IDENFR b
SEMICN ;
RBRACE }
DEFTK def
IDENFR func2_minu
LPARENT (
INTTK int
IDENFR a
COMMA ,
INTTK int
IDENFR b
RPARENT )
ARROW ->
INTTK int
LBRACE {
RETURNTK return
IDENFR a
MINU -
IDENFR b
SEMICN ;
RBRACE }
DEFTK def
IDENFR func2_mult
LPARENT (
INTTK int
IDENFR a
COMMA ,
INTTK int
IDENFR b
RPARENT )
ARROW ->
INTTK int
LBRACE {
RETURNTK return
IDENFR a
MULT *
IDENFR b
SEMICN ;
RBRACE }
DEFTK def
IDENFR func2_div
LPARENT (
INTTK int
IDENFR a
COMMA ,
INTTK int
IDENFR b
RPARENT )
ARROW ->
INTTK int
LBRACE {
RETURNTK return
IDENFR a
DIV /
IDENFR b
SEMICN ;
RBRACE }
CLASSTK Class
IDENFR C
LBRACE {
INTTK int
IDENFR p
SEMICN ;
INTTK int
IDENFR q
SEMICN ;
FUNCTK func
LSS <
INTTK int
GRE >
IDENFR f
SEMICN ;
INTTK int
IDENFR x
LBRACK [
NUMBER 4
RBRACK ]
SEMICN ;
FUNCTK func
LSS <
INTTK int
GRE >
IDENFR f_array
LBRACK [
NUMBER 4
RBRACK ]
SEMICN ;
CONSTRUCTTK constructor
LPARENT (
INTTK int
IDENFR p
COMMA ,
INTTK int
IDENFR q
COMMA ,
INTTK int
IDENFR r
RPARENT )
LBRACE {
IDENFR this
POINT .
IDENFR p
ASSIGN =
IDENFR p
SEMICN ;
IDENFR this
POINT .
IDENFR q
ASSIGN =
IDENFR q
SEMICN ;
IDENFR this
POINT .
IDENFR x
LBRACK [
NUMBER 0
RBRACK ]
ASSIGN =
IDENFR r
ADD +
NUMBER 0
SEMICN ;
IDENFR this
POINT .
IDENFR x
LBRACK [
NUMBER 1
RBRACK ]
ASSIGN =
IDENFR r
ADD +
NUMBER 1
SEMICN ;
IDENFR this
POINT .
IDENFR x
LBRACK [
NUMBER 2
RBRACK ]
ASSIGN =
IDENFR r
ADD +
NUMBER 2
SEMICN ;
IDENFR this
POINT .
IDENFR x
LBRACK [
NUMBER 3
RBRACK ]
ASSIGN =
IDENFR r
ADD +
NUMBER 3
SEMICN ;
RBRACE }
RBRACE }
MAINTK Main
LBRACE {
INTTK int
IDENFR x
ASSIGN =
NUMBER 5
SEMICN ;
INTTK int
IDENFR y
ASSIGN =
NUMBER 6
SEMICN ;
INTTK int
IDENFR z
ASSIGN =
IDENFR func1
LPARENT (
IDENFR x
COMMA ,
IDENFR y
RPARENT )
SEMICN ;
INTTK int
IDENFR i
ASSIGN =
NUMBER 0
SEMICN ;
FUNCTK func
LSS <
INTTK int
GRE >
IDENFR fu
ASSIGN =
IDENFR func1
SEMICN ;
PRINTTK print
LPARENT (
STRCON "{} {}\n"
POINT .
FORMATTK format
LPARENT (
IDENFR fu
LPARENT (
IDENFR x
COMMA ,
IDENFR y
RPARENT )
COMMA ,
IDENFR z
RPARENT )
RPARENT )
SEMICN ;
IDENFR x
ADD +
ADD +
SEMICN ;
IDENFR y
ADD +
ADD +
SEMICN ;
IDENFR C
IDENFR c1
ASSIGN =
IDENFR C
LPARENT (
IDENFR x
COMMA ,
IDENFR y
COMMA ,
IDENFR z
RPARENT )
SEMICN ;
IDENFR c1
POINT .
IDENFR f
ASSIGN =
IDENFR func1
SEMICN ;
IDENFR c1
POINT .
IDENFR f_array
LBRACK [
NUMBER 0
RBRACK ]
ASSIGN =
IDENFR func2_add
SEMICN ;
IDENFR c1
POINT .
IDENFR f_array
LBRACK [
NUMBER 1
RBRACK ]
ASSIGN =
IDENFR func2_minu
SEMICN ;
IDENFR c1
POINT .
IDENFR f_array
LBRACK [
NUMBER 2
RBRACK ]
ASSIGN =
IDENFR func2_mult
SEMICN ;
IDENFR c1
POINT .
IDENFR f_array
LBRACK [
NUMBER 3
RBRACK ]
ASSIGN =
IDENFR func2_div
SEMICN ;
FORTK for
LPARENT (
IDENFR i
ASSIGN =
NUMBER 0
SEMICN ;
IDENFR i
LSS <
NUMBER 4
SEMICN ;
IDENFR i
ADD +
ADD +
RPARENT )
LBRACE {
PRINTTK print
LPARENT (
STRCON "Yeah ! the result is {} {}\n"
POINT .
FORMATTK format
LPARENT (
IDENFR c1
POINT .
IDENFR x
LBRACK [
IDENFR i
RBRACK ]
COMMA ,
IDENFR c1
POINT .
IDENFR f_array
LBRACK [
IDENFR i
RBRACK ]
LPARENT (
IDENFR x
COMMA ,
IDENFR y
RPARENT )
RPARENT )
RPARENT )
SEMICN ;
RBRACE }
PRINTTK print
LPARENT (
STRCON "{}\n"
POINT .
FORMATTK format
LPARENT (
IDENFR c1
POINT .
IDENFR f
LPARENT (
IDENFR c1
POINT .
IDENFR p
COMMA ,
IDENFR c1
POINT .
IDENFR q
RPARENT )
RPARENT )
RPARENT )
SEMICN ;
RBRACE }
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xu-wenchong/buaa_-adsl.git
git@gitee.com:xu-wenchong/buaa_-adsl.git
xu-wenchong
buaa_-adsl
BUAA_ADSL
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385