background preloader

Compilers

Facebook Twitter

The Racket Language. ANTLR. Python AST Explorer. Theory and Practice of Source Code Parsing with ANTLR and Roslyn. Provides several approaches to analysis of the source code written in different programming languages: This series of articles focuses on the structure and operation principles of the signature analysis module (PM, pattern matching). The key benefits of such an analyzer include high performance, simplicity of pattern description, and scalability across various languages.

The disadvantage of this approach is that the module is not able to analyze complex vulnerabilities, which require developing high-level models of code execution. This article focuses on the first stage that includes parsing, comparing functionalities and features of various parsers, as well as applying theoretical principles to practice using Java, PHP, PLSQL, TSQL and even C# grammars. Thus far, in fact all the syntax of modern programming languages can be defined by context-free grammars.

Moreover, the language may be context-free in one case and context-sensitive in the other. Expr : expr '*' expr | expr '+' expr | or. .NET Compiler Platform (a.k.a Roslyn) - An Overview. Roslyn has been known as the code name for the next generation of C# compiler, at least since its first public preview was released in 2011. Infact the project started internally at Microsoft a couple of years earlier. Even before its first final release in Visual Studio 2015, it started to mean a lot more than just a new compiler.

At that time, it also got a new official name: .NET Compiler Platform. Nevertheless, the word Roslyn is still a part of developer vocabularies and will probably remain in use for quite some time. Let us look at what one might be referring to today when mentioning Roslyn, what the current state of the project is, and how it can be beneficial to developers. This article is published from the DNC Magazine for .NET Developers and Architects. .NET Compiler Platform (a.k.a Roslyn) Most developers treat compilers as black boxes: they receive source code as input, do some processing on it, and output executable binaries. Image 1: Compiler as a black box Conclusion: Anders Hejlsberg on Modern Compiler Construction | Seth Juarez. LLVM Architecture. LLVM has been creating waves recently as the compiler for the iPhone and in a number of other places.

David Chisnall takes a look at what makes this project so interesting. I talked a bit about the low-level virtual machine (LLVM) when comparing open source compilers. Since then, I’ve become involved with the LLVM project, working on code generation for the Objective-C language. In this article, I’ll give you a more in-depth overview of how LLVM works. LLVM is a virtual machine infrastructure that doesn’t provide any of the high-level features you’d find in something like the Java or .NET virtual machines, including garbage collection and an object model.

The basic design of LLVM is an unlimited register machine (URM), familiar to most computer scientists as a universal model of computation. Registers are single-assignment. LLVM programs are assembled from basic blocks. If(condition) a = 1; else a = 2; In LLVM, there are two sorts of registers: The Design of LLVM.