forked from llSourcell/Lets_Build_a_Compiler_LIVE
-
Notifications
You must be signed in to change notification settings - Fork 0
History
Lancine Doumbia edited this page Jul 12, 2022
·
2 revisions
Emmet like plugin start now.
Problem: Defining the options API can be time consuming. Some plugins can cut down time, but relies on static snippets
Plan:
Input: A string of characters Output: The assembled string structure of the options API (for now) Steps: 1. Type a string input into function 2. Scan the string 3. for each cluster of characters, trigger a control flow statement and store the string into the final variable 4. print final variable
Pseudocode: ?
Goal since June 10ish 2022 Friday
Build a optimized version of Vue VSCode Snippets. Make it better.
Test the project out by constructing a JS function
Structure Of A Parser 457am 6/15/2022
https://tomassetti.me/parsing-in-javascript/
A parser is usually composed of two parts:
a lexer, also known as scanner or tokenizer,
and the proper parser. Not all parsers adopt this two-steps schema: some parsers do not depend on a lexer. They are called scannerless parsers.
A lexer and a parser work in sequence:
the lexer scans the input and produces the matching tokens,
the parser scans the tokens and produces the parsing result.
437 + 734
The definitions used by lexers or parser are called rules or productions.
A lexer rule will specify that a sequence of digits correspond to a token of type NUM,
while a parser rule will specify that a sequence of tokens of type NUM, PLUS, NUM corresponds to an expression.
NUM 437
PLUS +
NUM 734
A parse tree is a representation of the code closer to the concrete syntax.
It shows many details of the implementation of the parser.
Early attempts
First 6/15/2022 3am
Second
Third
Fourth 6/21/2022 507pm