Narcissus - JS implemented in JS. Lexical scanner and parser.
Narcissus - JS implemented in JS. Lexical scanner and parser.
10åã§æ¸ãæ§æ解æå¨ããã£ã¦ã¿ã¾ããã å帰ä¸éæ³ã使ã£ã¦ãã¾ãã ååæ¼ç®ãã¦çµæãè¿ãã¾ãã æåã«ãç°¡åãªã¹ã¿ãã¯ã®ããã«ä½¿ããæåèªã¿è¾¼ã¿é¢æ°pop(),push(),peek()ãã¤ããã ãã®é¢æ°ãå©ç¨ãã¦ãå帰ä¸éæ§æ解æã®é¢æ°expr,term,factãä½æãã¦ãã¾ãã åå¥è§£æã¯ãpop()ã¨fact()é¢æ°å ã§ãã£ã¦ãæãã§ãã æéãä½ã£ãåã空ç½ã®å¦çãå ¥ãã¦ãã¾ãã htmlã¯ãããã®ã使ã£ã¦ãã®ã§ãå®è³ªãä½ã£ã¦ãæéã¯5,6åã§ãã ã ã¼ãã¼ http://sakurai.s59.xrea.com/10min/10minparse.html ã§ãããã£ããã® http://sakurai.s59.xrea.com/10min/parse.html 詳ããã¨ããã¯ãid:tanakhããã® 10åã§æ¸ããããæ軽ãã¼ã¶ã¼ãè¦ã¦ãã ããã http://fxp.
http://sakurai.s59.xrea.com/10min/10minlex.html ãªããããã£ã¦ã¿ã¾ããã å¾ã§è¦ãããæå¾å¤±æãã¦ã¦æ¥ããããã§ãã ååããsakuraiãªããã§ãsakuraã¨ãã£ã¿ä½¿ã£ã¦ã¿ã¾ããã æ£è¦è¡¨ç¾ä½¿ã£ã¦ã¾ãã åå¥è§£æã£ã¦ãflexãã¤ã³ã¹ãã¼ã«ãããã¨ãã¦å¤±æããããææ¸ãã§é·ã æ¸ãã¦ãã£ã¦ã ããã©ãããã¦å¤§å¤ã ã£ããã£ã¦ã®ãå¤ãããã«æãã®ã§ã ããã©ãããã£ã¦ããã¤ã¡ã¼ã¸ãææãããã¦ãã£ã¦ã¿ã¾ããã 次åã¯ï¼ï¼åã§æ¸ãæ§æ解æå¨ããããã¨æãã¾ãã
ããã使ã£ã¦ãããªãã¨ãåºæ¥ã¾ãã ãµã³ãã« http://sample.ecmascript.jp/tokenizer/ ã½ã¼ã¹ http://sample.ecmascript.jp/tokenizer/character.js http://sample.ecmascript.jp/tokenizer/tokenizer.js ãµã³ãã«ã®ä½¿ããã ä¾ãã° textarea ã« var hoge = 3e3;ã¨æ¸ã㨠No Type Operation Atom Dval 1VARDEFVAR2NAMENAMEhoge3ASSIGNNOP4NUMBER30005SEMIã¨è¡¨ç¤ºããã ã½ã¼ã¹ã®ä½¿ããã character.jsãèªã¿è¾¼ã tokenizer.jsãèªã¿è¾¼ã new TokenStream(source) instance.getToken(); var tokenStre
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}