词法分析,语法分析

最近看到公司的产品有词法分析,语法分析,很有意思,阅读,学习,记录下。

1. 词法分析 

lexical analysis is the process of converting a sequence of characters into a sequence of tokens。

比如:Time()<="080000",要让计算器知道Time()是什么意思,计算机认不认识,究其源头是已被定义的,可能是你可能是我也可能是其它人。这里预先定义一些原子Time()我们才明白“080000”是什么意思。

 

2. 语法分析

syntactic analysis , is the process of analyzing a sequence of tokens to determine their grammatical structure with respect to a given (more or less) formal grammar . And it checks for correct syntax and builds a data structure (often some kind of parse tree , abstract syntax tree or other hierarchical structure) implicit in the input tokens.

比如:Time()<="080000",要让计算器知道这一句Time()<="080000"是什么意思,源头依旧是我们定义的,时间小于 8 点 0 分 0 秒

 

3. 个人理解

是一个从小到大、从大到小的过程。像编译器中,我们定义char c,计算器知道要去划一个字节的空间。c = 'A‘; 把划分的一字节空间写入41H。

 

转载于:https://www.cnblogs.com/ashen/p/10514806.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值