解析器详细工作,用于查询的语法检查 [英] parser working in detail for syntax checking of query

查看:86
本文介绍了解析器详细工作,用于查询的语法检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解析器如何检查语法?
我希望c ++程序理解

how parser checks syntax ?
i want c++ program to understand

推荐答案

在解析代码时会自动检查语法.因为您正在蚕食角色并消化了您期望的一切.例如,在某些时候,您可能期望一个运算符,并且如果您窥视下一个字符(忽略空格),而实际上却不是,那么您就知道语法是不正确的.当偶然发现不是选项的字符时,您仅在解析过程中输出语法错误.当您手工制作编译器时,会遇到导致else的情况,这自然会导致语法错误.

在这里查看更多资源链接:
http://stackoverflow.com/questions/1669/learning-to-write-a-compiler [^ ]

祝你好运!
The syntax is checked automatically when parsing the code. Because you are eating away the characters and digesting everything you expect. At certain points you would for example expect an operator and if you peek at the next character (ignoring whitespace) and it isn''t, you know the syntax isn''t right. You simply output a syntax error in your parsing process when you stumble upon characters that aren''t an option. When you craft your compiler by hand you encounter situations that result in an else which result in a syntax error naturally.

Have a look here for more resource links:
http://stackoverflow.com/questions/1669/learning-to-write-a-compiler[^]

Good luck!


这篇关于解析器详细工作,用于查询的语法检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆