Pages tagged "antlrv3.2"

Using ANTLRv3 with C/C++

Introduction

Recently I had to build a parser and lexer as part of a compilers group project in college. Out group had read around a bit, and decided we would use ANTLR for our project. We also wanted to write our compiler in C++. However, although the documentation for using ANTLR with C was fairly decent, concrete examples of using ANTLR with C or C++ are few and far between. Hopefully this short guide will help you do what we found very difficult - taking the first steps towards creating a powerful lexer and parser using ANTLR in C++.

A few notes before we get into the actual code: