Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10장 #33

Open
myeongjae-kim opened this issue May 2, 2024 · 0 comments
Open

10장 #33

myeongjae-kim opened this issue May 2, 2024 · 0 comments

Comments

@myeongjae-kim
Copy link

“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."

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


과제 환경 셋업

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant