Leveling Up Your Parsing Game With AST

anonymous·2022년 4월 17일
0

The Compiler

목록 보기
3/3
post-thumbnail

Being able to understand how something is abstracted away and why can make you a better programmer

용어

Parse

  • Resolve Component parts and describe their syntatic roles

Tree

  • Abstract data type that simulates hierarhical tree structure

Parse Tree

  • Every developer needs to make sure their code is understood by machines
  • This is one of the underlying abstractions that allow the code that we write to become readable by computers.
  • Pictorial version of the grammatical structure of a sentence.
  • Gives concrete idea of the syntax of the particular sentence.
  • Used in pedagogy(study of teaching) to teach students how to identify parts of a sentence.

Sentence Diagramming (Sentence breaking into smallest parts) example

Code Diagramming

  • All of our code can be simplified into sets of expressions.
  • EX) Calculator program

SYNTAX

APPLIED

AST (abstract syntax tree)

  • Simplified , condensed parse tree / syntax tree
  • contains info. related to analyzing source text
  • ignores extra syntatic info. used in parsing text

출처

https://www.geeksforgeeks.org/parse-tree-in-compiler-design/

https://medium.com/basecs/grammatically-rooting-oneself-with-parse-trees-ec9daeda7dad

https://medium.com/basecs/leveling-up-ones-parsing-game-with-asts-d7a6fc2400ff

profile
기술블로거입니다

0개의 댓글