Posts

Parsing in Python: Tools and Libraries

Parsing In Python: Tools And Libraries

This is an article similar to a previous one we wrote: Parsing in Java, so the introduction is the same. Skip to chapter 3 if you have already read it. If you need to parse a language, or document, from Python there are fundamentally three ways to solve the problem: use an existing library supporting […]

ANTLR Mega Tutorial

The ANTLR Mega Tutorial

Parsers are powerful tools, and using ANTLR you could write all sort of parsers, usable from many different languages. In this complete tutorial we are going to: explain the basics: what a parser is, what it can be used for see how to setup ANTLR to be used from Javascript, Python, Java and C# discuss […]

Python reflection: how to list modules and inspect functions

Python reflection: how to list modules and inspect functions

Recently I have been playing with some ideas about applying static analysis to Python and building a Python editor in Jetbrains MPS. To do any of this I would need to first build a model of Python code. Recently we have seen how to parse Python code, however we still need to consider all the […]

Parsing any language in 5 minutes

Parsing Any Language in Java in 5 Minutes Using ANTLR: for Example Python

I like processing code for several purposes, like static analysis or automated refactoring. The interesting part to me is to reason on the models you build from the Abstract Syntax Tree (AST). To get there you need a way to get the AST from your source files. This can be done easily using ANTLR and the […]

dynamic, static, optional, structural typing and engineering challenges

Dynamic, static, optional, structural typing and engineering challenges

How an engineer should NOT look at technical matters Dynamic versus static typing is one of those confrontations that seams to attracts zealots. It really sadden me to see how people tend to defend vehemently their side simply because they are not able to understand the other position. In my opinion if you do not get […]