什么是分析? [英] What is parsing?

查看:137
本文介绍了什么是分析?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解析是我来到翻过很多的发展,但作为一个初级的那些事情,我想我会找到窍门在某些时候,它需要的人。在我目前的项目我已经被告知要找到并使用一个HTML解析器为特定的功能,我发现一对夫妇在网络上,但到底是什么一个HTML解析器实际上做?什么意思解析的对象??


解决方案

解析通常适用于文本 - 阅读文本,并将其转换成一个更有用的内存格式,其行为理解意味着什么,在一定程度上。因此,例如,XML解析器将字符(或字节)的序列,并将它们转换成元素,属性等。



在某些情况下(尤其是编译器)有一个词法分析和语法分析,所以解析器的真正理解部分之间的分离工作在标记序列(标识符,运营商等),而不是对原始字符

Parsing is something I came accross alot in development, but as a junior its one of those things I assume I will get the hang of at some point, when its needed. In my current project I've been told to find and use an HTML parser for a certain function, I have found a couple on the web, but what does an HTML parser actually do? And what does it mean to parse an object??

解决方案

Parsing usually applies to text - the act of reading text and converting it into a more useful in-memory format, "understanding" what it means to some extent. So for example, an XML parser will take the sequence of characters (or bytes) and convert them into elements, attributes etc.

In some cases (particularly compilers) there's a separation between lexical analysis and syntactic analysis, so the real "understanding" part of the parser works on a sequence of tokens (identifiers, operators etc) rather than on the raw characters.

这篇关于什么是分析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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