What is parsing?

前端 未结 8 1085
猫巷女王i
猫巷女王i 2020-12-23 02:24

Parsing is something I come across a lot in development, but as a junior it is one of those things I assume I will get the hang of at some point, when it is needed. In my cu

相关标签:
8条回答
  • 2020-12-23 02:33

    It is the process of identifying the tokens [tags, attributes] inside an HTML.

    0 讨论(0)
  • 2020-12-23 02:41

    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.

    0 讨论(0)
  • 2020-12-23 02:41

    You can start here: http://en.wikipedia.org/wiki/Parsing. Short excerpt:

    Parsing or syntactic analysis is the process of analysing a string of symbols, either in natural language or in computer languages, conforming to the rules of a formal grammar. The term parsing comes from Latin pars (orationis), meaning part (of speech).

    0 讨论(0)
  • 2020-12-23 02:42

    Parsing is taking a set of data and extracting the meaningful information from it. With HTML parsing, you're looking to read some html and return a structured set of tags and text

    0 讨论(0)
  • 2020-12-23 02:43

    A parser is a compiler / interpreter component that breaks data into smaller elements for easy translation into another language. A parser takes input in the form of a sequence of tokens or program instructions and usually builds a data structure in the form of a parse tree or an abstract syntax tree.

    0 讨论(0)
  • 2020-12-23 02:45

    Parse (computers), by Dictionary.com:

    To analyze (a string of characters) in order to associate groups of characters with the syntactic units of the underlying grammar.

    0 讨论(0)
提交回复
热议问题