zbraniecki / pyast Goto Github PK
View Code? Open in Web Editor NEWBasic set of classes for building abstract syntax trees
License: BSD 3-Clause "New" or "Revised" License
Basic set of classes for building abstract syntax trees
License: BSD 3-Clause "New" or "Revised" License
PyAST is a library that allows for creating AST structures using declarative programming form. example: == jsast.py == import pyast as ast class Node(ast.Node): pass class Statement(Node): pass class Expression(Pattern): pass class Operator(Node): token = ast.field(("+","=","-","==","!=",">",">")) class Identifier(Expression): name = ast.field((str, unicode)) class Literal(Expression): value = ast.field((str, bool, int, NoneType)) class Program(ast.Node): body = ast.seq(Statement, null=True) class ExpressionStatement(Statement): expression = ast.field(Expression) class AssignmentExpression(Expression): operator = ast.field(Operator) left = ast.field(Expression) right = ast.field(Expression) == main.py == from jsast import * prog = Program() prog.body.append( ExpressionStatement( AssignmentExpression( Operator("="), Identifier("x"), Literal(2) ))) # result: x=2; ========= pyast.DEBUG variable defines if pyast operates in DEBUG mode in which the strong typing is enforced at cost of performance, or optimized mode when all the checks are inactive.
It seems this package is out of date on PyPi. I would like to use it for a project so if you could update it, it would be much appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.