±ÕÇüÀ» ÀÌ·ç´Ù ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Other/Proprietary Li...
- °Ô½ÃÀÚ À̸§:
- Zbigniew Braniecki
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- https://wiki.mozilla.org/Silme
±ÕÇüÀ» ÀÌ·ç´Ù ű×
±ÕÇüÀ» ÀÌ·ç´Ù ¼³¸í
¼±¾ðÀû AST¸¦ ±¸ÃàÇϱâÀ§ÇÑ Python ¸ðµâ Pyast´Â ¼±¾ðÀû ÇÁ·Î±×·¡¹Ö Form.ExampleÀ» »ç¿ëÇÏ¿© AST ±¸Á¶¸¦ ¸¸µé ¼öÀÖ´Â ÆÄÀ̽㠶óÀ̺귯¸®ÀÔ´Ï´Ù. jsast.pyimport pyast AS ASTCLASS ³ëµå (³ëµå) : PassClass Ç¥Çö½Ä (ÆÐÅÏ) : Æнº Ŭ·¡½º ¿¬»êÀÚ (³ëµå) : ÅäÅ« = AST.FIELD (( "+", "=", "-", "==", "! ="> ">"> ")) Ŭ·¡½º ½Äº°ÀÚ (Ç¥Çö½Ä) : name = ast.field ( STR, À¯´Ï ÄÚµå) Ŭ·¡½º ¸®ÅÍ·² (Ç¥Çö½Ä) : VALUE = AST.FIELD (sTR, BOOL, int, nonetype)) Ŭ·¡½º ÇÁ·Î±×·¥ (ast.node) : body = ast.seq (¹®, null = true) Ŭ·¡½º ExpressionStatement ( ¹®) : expression = ast.field (expression = ast.field) : operator = ast.field (¿¬»êÀÚ) left = ast.field (Ç¥Çö½Ä) ¿À¸¥ÂÊ = ast.field (Ç¥Çö½Ä) main.pyfrom JSast °¡Á® ¿À±â * prog = ÇÁ·Î±×·¥ () prog.body.append (expaintStatement (assignmentExpression ( "x"), ¸®ÅÍ·² (2)))))) # °á°ú : x = 2; pyast.debug º¯¼ö´Â ÆÄÀÌ ºø¾Æ°¡ µð¹ö±×·Î ÀÛµ¿ÇÏ´ÂÁö Á¤ÀÇÇÕ´Ï´Ù. ¼º´É ºñ¿ëÀ¸·Î °·ÂÇÑ Å¸ÀÌÇÎÀÌ Àû¿ëµÇ´Â ¸ðµå ¶Ç´Â ¾Ë ¶§ ÃÖÀûÈ µÈ ¸ðµå °Ë»ç°¡ ºñÈ°¼º »óÅÂÀÔ´Ï´Ù. ¿ä±¸ »çÇ× : ¡¤ ÆÄÀ̽ã
±ÕÇüÀ» ÀÌ·ç´Ù °ü·Ã ¼ÒÇÁÆ®¿þ¾î