Skip to content

10장 #33

@myeongjae-kim

Description

@myeongjae-kim

“Thus, while most programmers don’t develop compilers in their regular jobs, many programmers have to parse and manipulate texts and data sets of complex and varying structures. These tasks can be done efficiently and elegantly using the algorithms and techniques described in this chapter.”


image

Figure 10.3 A subset of the Jack language grammar, and Jack code segments that are either accepted or rejected by the grammar.

타입스크립트에서도 비슷하게 해볼 수 있을듯

타입 레벨 html parser: microsoft/TypeScript#40336

A grammar is written in a meta-language: a language describing a language.

가장 유명한건 BNF form: https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form


"looking ahead one token suffices to resolve, without ambiguity, which rule to use next. Grammars that have this lingual property are called LL (1). These grammars can be handled simply and elegantly by recursive descent algorithms, without backtracking."

앞에 뭐가 나왔는지 하나만 보면 된다. 많이 봐야할수록 복잡해짐


과제 환경 셋업

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions