Questions tagged [asdl]

Zephyr Abstract Syntax Definition Language

Abstract Syntax Definition Language (ASDL) is a generic tool for specifying Abstract Syntax Trees (ASTs) than can then be ported to multiple language targets. It is a tool for writing compilers and interpreters.

See the specification at: ftp://ftp.cs.princeton.edu/techreports/1997/554.pdf

ASDL is used by the specification of the AST for the Python programming language.

5 questions
12
votes
3 answers

Zephyr ASDL (Abstract Syntax Description Language)

Question: What is the Zephyr ASDL and how does it relate to other compiler technologies like lexers and parser generators? (I would appreciate it if you were reasonably complete, but point to other references online when it gets rather technical,…
math4tots
  • 8,540
  • 14
  • 58
  • 95
12
votes
2 answers

How to get arguments list of a built-in Python class constructor?

I'm trying to use the inspect module, however it seems I can't use it on a built-in (native?) class, or else I misunderstood. I'm using Python 2.7 and tried with Python 3.2. This is working: >>> import inspect >>> class C: ... def…
Julian Bilcke
  • 309
  • 1
  • 4
  • 15
9
votes
1 answer

What parser generator does CPython use?

I was reading this page in the documentation, and noticed that it says This is the full Python grammar, as it is read by the parser generator and used to parse Python source files However, I'm having difficulty finding out what parser generator…
math4tots
  • 8,540
  • 14
  • 58
  • 95
5
votes
1 answer

How to modify the Python source code in order to add a new AST node?

For example, if I was to create a node called "Something" that I wanted to use in a Python AST tree, where and which changes would I have to add to Python source code in order to do that? I know that I should start out with Python.asdl where the…
Nonomus
  • 127
  • 1
  • 9
0
votes
1 answer

What does ASDL stand for?

I see in the ast docs -- ASDL's 7 builtin types are: -- identifier, int, string, bytes, object, singleton, constant In that context what does ASDL stand for? Is it just the cpython grammar?
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468