diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..d47f207
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,11 @@
+---
+BasedOnStyle: LLVM
+IndentWidth: 2
+---
+Language: Cpp
+PointerAlignment: Left
+AllowShortIfStatementsOnASingleLine: true
+ColumnLimit: 100
+AlignEscapedNewlines: DontAlign
+BreakStringLiterals: false
+SpaceAfterTemplateKeyword: false
diff --git a/.gitignore b/.gitignore
index 098b43f..796b96d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1 @@
-/Monicelli.output
-/*.user
-/mcc
/build
-/nbproject
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 203e57d..75063b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,84 +1,31 @@
-#
-# Monicelli: an esoteric language compiler
-#
-# Copyright (C) 2014 Stefano Sanfilippo
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
+# Copyright 2017 the Monicelli project authors. All rights reserved.
+# Use of this source code is governed by a GPLv3 license, see LICENSE.txt.
+cmake_minimum_required(VERSION 3.0)
project(Monicelli)
-cmake_minimum_required(VERSION 2.8)
set(CMAKE_BUILD_TYPE Release)
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
-message("== Only a limited set of platforms was tested. We need your help!")
-message("== Report build errors to https://github.com/esseks/monicelli/issues")
-
-## 1. Compiler sanity check
-
-try_run(
- execution_results
- supported_compiler
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/cmake/features.cpp
- COMPILE_DEFINITIONS -std=c++0x
- OUTPUT_VARIABLE features_build_log
-)
-
-if (checkfeat)
- message(${features_build_log})
-endif()
-
-if (NOT supported_compiler)
- message(FATAL_ERROR
- "Some C++11 features we need are not implemented by your compiler.\n"
- "Run cmake with -Dcheckfeat=1 to see the exact cause."
- )
-endif()
-
-if (execution_results MATCHES FAILED_TO_RUN)
- message(FATAL_ERROR
- "Your compiler supports the set of C++11 features we need, "
- "but something failed.\n"
- "Run cmake with -Dcheckfeat=1 to see the exact cause."
- )
-endif()
-
-## 2. Find Flex and Bison
-
-include(macosx_homebrew)
-
-if (CMAKE_HOST_APPLE)
- find_package_prefer_brew(BISON REQUIRED)
- find_package_prefer_brew(FLEX 2.5 REQUIRED)
-else()
- find_package(BISON REQUIRED)
- find_package(FLEX 2.5 REQUIRED)
-endif()
-
-if (BISON_VERSION VERSION_LESS 2.5)
- message(FATAL_ERROR "At least Bison 2.5 is required.")
-elseif(BISON_VERSION VERSION_LESS 3.0)
- message("== Bison 2.5 was found. You have to apply cmake/bison2.patch...")
-endif()
-
-## 2. Build Monicelli
-
-include(package)
+find_package(Doxygen)
add_subdirectory(src)
-install(FILES README.md LICENSE.txt DESTINATION doc/)
+if (DOXYGEN_FOUND)
+ set(DOXYGEN_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
+ ${DOXYGEN_CONFIG}
+ @ONLY
+ )
+
+ add_custom_target(doc
+ DEPENDS ${DOXYGEN_CONFIG}
+ COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONFIG}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ VERBATIM
+ )
+endif()
+
+install(FILES README.md LICENSE.txt DESTINATION doc/monicelli)
diff --git a/Doxyfile.in b/Doxyfile.in
new file mode 100644
index 0000000..99b1117
--- /dev/null
+++ b/Doxyfile.in
@@ -0,0 +1,305 @@
+# Doxyfile 1.8.11
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING = UTF-8
+PROJECT_NAME = "Monicelli"
+PROJECT_NUMBER =
+PROJECT_BRIEF =
+PROJECT_LOGO =
+OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/doxy
+CREATE_SUBDIRS = NO
+ALLOW_UNICODE_NAMES = NO
+OUTPUT_LANGUAGE = English
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF =
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH =
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = NO
+QT_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS = YES
+SEPARATE_MEMBER_PAGES = NO
+TAB_SIZE = 4
+ALIASES =
+TCL_SUBST =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+OPTIMIZE_FOR_FORTRAN = NO
+OPTIMIZE_OUTPUT_VHDL = NO
+EXTENSION_MAPPING =
+MARKDOWN_SUPPORT = YES
+AUTOLINK_SUPPORT = YES
+BUILTIN_STL_SUPPORT = NO
+CPP_CLI_SUPPORT = NO
+SIP_SUPPORT = NO
+IDL_PROPERTY_SUPPORT = YES
+DISTRIBUTE_GROUP_DOC = NO
+GROUP_NESTED_COMPOUNDS = NO
+SUBGROUPING = YES
+INLINE_GROUPED_CLASSES = NO
+INLINE_SIMPLE_STRUCTS = NO
+TYPEDEF_HIDES_STRUCT = NO
+LOOKUP_CACHE_SIZE = 0
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = NO
+EXTRACT_PACKAGE = NO
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = NO
+EXTRACT_ANON_NSPACES = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+HIDE_COMPOUND_REFERENCE= NO
+SHOW_INCLUDE_FILES = YES
+SHOW_GROUPED_MEMB_INC = NO
+FORCE_LOCAL_INCLUDES = NO
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_MEMBERS_CTORS_1ST = NO
+SORT_GROUP_NAMES = NO
+SORT_BY_SCOPE_NAME = NO
+STRICT_PROTO_MATCHING = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_FILES = YES
+SHOW_NAMESPACES = YES
+FILE_VERSION_FILTER =
+LAYOUT_FILE =
+CITE_BIB_FILES =
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+WARN_AS_ERROR = NO
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src
+INPUT_ENCODING = UTF-8
+FILE_PATTERNS =
+RECURSIVE = YES
+EXCLUDE = @CMAKE_CURRENT_BINARY_DIR@
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXCLUDE_SYMBOLS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+FILTER_SOURCE_PATTERNS =
+USE_MDFILE_AS_MAINPAGE =
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION = NO
+REFERENCES_LINK_SOURCE = YES
+SOURCE_TOOLTIPS = YES
+USE_HTAGS = NO
+VERBATIM_HEADERS = YES
+CLANG_ASSISTED_PARSING = NO
+CLANG_OPTIONS =
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = YES
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_EXTRA_STYLESHEET =
+HTML_EXTRA_FILES =
+HTML_COLORSTYLE_HUE = 220
+HTML_COLORSTYLE_SAT = 100
+HTML_COLORSTYLE_GAMMA = 80
+HTML_TIMESTAMP = NO
+HTML_DYNAMIC_SECTIONS = NO
+HTML_INDEX_NUM_ENTRIES = 100
+GENERATE_DOCSET = NO
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+CHM_INDEX_ENCODING =
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+GENERATE_TREEVIEW = NO
+ENUM_VALUES_PER_LINE = 4
+TREEVIEW_WIDTH = 250
+EXT_LINKS_IN_WINDOW = NO
+FORMULA_FONTSIZE = 10
+FORMULA_TRANSPARENT = YES
+USE_MATHJAX = NO
+MATHJAX_FORMAT = HTML-CSS
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+MATHJAX_EXTENSIONS =
+MATHJAX_CODEFILE =
+SEARCHENGINE = YES
+SERVER_BASED_SEARCH = NO
+EXTERNAL_SEARCH = NO
+SEARCHENGINE_URL =
+SEARCHDATA_FILE = searchdata.xml
+EXTERNAL_SEARCH_ID =
+EXTRA_SEARCH_MAPPINGS =
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = YES
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4
+EXTRA_PACKAGES =
+LATEX_HEADER =
+LATEX_FOOTER =
+LATEX_EXTRA_STYLESHEET =
+LATEX_EXTRA_FILES =
+PDF_HYPERLINKS = YES
+USE_PDFLATEX = YES
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+LATEX_SOURCE_CODE = NO
+LATEX_BIB_STYLE = plain
+LATEX_TIMESTAMP = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+RTF_SOURCE_CODE = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_SUBDIR =
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+GENERATE_DOCBOOK = NO
+DOCBOOK_OUTPUT = docbook
+DOCBOOK_PROGRAMLISTING = NO
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+EXTERNAL_PAGES = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+MSCGEN_PATH =
+DIA_PATH =
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = YES
+DOT_NUM_THREADS = 0
+DOT_FONTNAME = Helvetica
+DOT_FONTSIZE = 10
+DOT_FONTPATH =
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+GROUP_GRAPHS = YES
+UML_LOOK = NO
+UML_LIMIT_NUM_FIELDS = 10
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+CALLER_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
+INTERACTIVE_SVG = NO
+DOT_PATH =
+DOTFILE_DIRS =
+MSCFILE_DIRS =
+DIAFILE_DIRS =
+PLANTUML_JAR_PATH =
+PLANTUML_INCLUDE_PATH =
+DOT_GRAPH_MAX_NODES = 50
+MAX_DOT_GRAPH_DEPTH = 0
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
diff --git a/README.md b/README.md
index dcef032..c976890 100644
--- a/README.md
+++ b/README.md
@@ -1,111 +1,119 @@
-Monicelli
-=========
+# Monicelli 2.0 "Cofandina"
+
+This all-new release mainly brings several improvements to the code that make
+it easier to hack and build new features. In addition to that:
+
+* `mcc` now produces an executable by default, no need to use (or install)
+ `lcc`, as it was previously the case. `mcc cofandina.mc -o cofandina` and
+ that's it! This feature currently requires a POSIX system (like Linux or
+ Mac OS X) with a C compiler installed (anything reasonably recent will do).
+
+* `mcc` does not depend on Boost anymore.
+
+* `mcc` has a new hand-written parser that should provide better error
+ messages. Now it's easier to stuzzicate your prematurated supercazzole.
+ Error messages are in plain English and not very antani. Apologies for that.
+
+* `mcc` now generates code that directly calls the C standard library. This
+ allows you to seamlessly link Monicelli object files with C/C++ code, without
+ any extra dependency on a Monicelli standard library.
+
+* The code generator in `mcc` has been ported to LLVM 3.8 and will continue
+ to be updated with new releases.
+
+* Modules are gone. This was a rather obscure feature that allowed to expose
+ functions implemented in C/C++ to Monicelli code using a YAML-based language.
+ Instead, it's now possible to declare a function with an empty body to signal
+ that it will be implemented in another file, be it in Monicelli or C/C++.
+ See the updated Turtle example.
+
+* The C++ transpiler is gone. It might come back again, though.
+
+# What's Monicelli anyway?
Monicelli is an esoterical programming language based on the so-called
"supercazzole" from the movie Amici Miei, a masterpiece of the Italian
comedy.
-There is no way to translate a "supercazzola" to English, so if you don't speak
-Italian, I'm afraid you won't understand. I'm really sorry for you :)
+Over the past few years I have tried to render the idea of "supercazzola" to
+non-Italian speakers, with little success. The closest I got was by describing
+it as "comically deceptive gibberish", which sadly does not capture the true
+essence of what a "supercazzola" (spelled "supercazzora" according to some) is.
+I'm still open to suggestions on how to better present Monicelli (the language)
+to the international public.
-Compilation
-===========
+# Compilation
-You will need `bison` version >= 3.0 (Bison 2.5 works but requires manual intervention),
-`flex` >= 2.5, `LLVM` >= 3.5, `Boost` >= 1.48, `YAML-cpp` >= 0.5 and any C++11 compiler.
-The build scripts are generated using CMake, version >= 2.8.
+A part of the Monicelli compiler (the lexer) is generated using `ragel`, which
+you will need to have installed. If this is not the case, the configuration
+script will warn you. Monicelli is developed with version 6.8, but any
+sufficiently recent release should do just fine.
+
+You will also need to have LLVM development libraries installed, version 3.8.
+Other versions might or might not work.
+
+Finally, you will need CMake, version 3.0 or higher.
A typical Makefile-based build workflow would be:
- mkdir build/
- cd build/
- cmake ..
- make
-
-During the Makefile generation, the build script will test the compiler for all
-the required features.
+ $ cd monicelli/
+ $ mkdir build/
+ $ cd build/
+ $ cmake .. -DCMAKE_INSTALL_PREFIX="$HOME/mcc"
+ $ make all install
If your tools are installed in non-standard locations
(e.g. Bison Brew on Mac OS X), you can alter the search path with:
- PATH=/path/to/bison cmake ..
+ $ PATH=/path/to/ragel cmake ..
-If you can't really upgrade to Bison 3.0, a patch for Bison 2.5
-is provided in `cmake/bison2.patch`. You will have to manually apply it with:
+`mcc` statically links LLVM, once compiled it will only depend on the C++
+runtime and on `libz`.
- patch -p 1 < cmake/bison2.patch
+## Note for non-POSIX platforms (like Windows)
-However note that compilation with Bison 2.5 is not supported and the patch might be
-removed in the future.
+The external linker is called using fork+exec for simplicity. This means that
+this part of the workflow will **not** work on non-POSIX systems, such as
+Windows. There, you will need to disable this feature at build time. You will
+only get object files (.o) that you will have to link, including a C runtime
+library, by yourself.
-###Building with LLVM on Debian/Ubuntu
-Debian Testing and Ubuntu >= 14.04 distribute a LLVM 3.5 development package
-**which is broken** (see [1](https://bugs.launchpad.net/ubuntu/+source/llvm/+bug/1365432)
-and [2](https://bugs.launchpad.net/ubuntu/+source/llvm/+bug/1387011)).
+You can disable the invocation of an external linker and make `mcc` compilable
+on Windows during CMake configuration by forcing the appropriate flag to OFF:
-Luckly, LLVM.org directly provides an APT repo which works fine.
-http://llvm.org/apt/ have all the relevant info for installing the repo.
-After that, the package we need is `llvm-3.5-dev`.
+ $ cmake .. -DENABLE_LINKER=OFF
-**This is only necessary for compilation, Debian/Ubuntu LLVM runtime libs
-and utilities work just fine.**
+## Tested platforms
-Usage
-=====
+The reference OS for building and testing Monicelli is Ubuntu 16.04 LTS. If the
+build is broken there, then it's a bug. Unfortunately I don't have many other
+platforms at hand to test, but it _should_ compile on many more POSIX systems,
+including Mac OS X. If you managed to compile Monicelli on your favourite
+platform and you needed a patch, it would be great if you could send a PR.
-###LLVM frontend
-Monicelli emits LLVM bitcode in its default configuration.
-A typical compilation workflow would be:
+# Usage
- $ ./mcc example.mc
- $ llc example.bc
- $ cc example.s libmcrt.a -o example
+Monicelli build an executable by default on POSIX systems
+(such as Linux, Mac OS X). Linking requires an external C compiler, anything
+decently modern and standard-conformant should do.
-In particular, note that the Monicelli runtime library must be compiled in or linked to use
-all of the I/O functions. Also note the use of the `llc` utility, which is
-provided by LLVM, to produce native assembler from LLVM bitcode.
+A typical invocation is very similar to what you would expect from your C
+compiler:
-Please be aware that the Monicelli standard library depends on the C stdlib,
-although this dependency is available on virtually any platform you might
-dream of compiling Monicelli on.
+ $ mcc example.mc -o example
+ $ ./example
-As such, `llvm` utilities are needed for compiling. Only the "low level"
-utilities (`opt` and `llc`) are needed, not the whole Clang/Clang++ suite.
-Usually, the relevant package goes under the name `llvm`.
+Please be aware that the Monicelli compiler depends on the availability of a C
+compiler and stdlib, although this dependency should be available on virtually
+all platforms where you might think to run `mcc`.
-A C compiler is used to simplify the assembling and linking step, but it could
-be skipped altogether with a small effort. If you want to try ;)
-
-`mcc` only performs minimal optimizations in order to ensure readibility when
-disassembling with `llvm-dis`. However, you might want to optimize the code
-using `opt` LLVM utility:
-
- $ opt example.bc | llc -o example.s
-
-in place of the simple `llc` compilation step. See `opt` documentation for a
-comprehensive list of optimizations available.
-
-###C++ transpiler
-`mcc` also works as a source to source compiler, which reads Monicelli
-and outputs a subset of C++. Use the option `--c++` or `-+` for that.
-
-A good way to learn on the field is comparing the resulting C++ with the
-input. Well, mostly with the beautified version of the input, `*.beauty.mc`.
-
-The typical command line would be:
-
- $ ./mcc --c++ examples/primes.mc
- $ c++ primes.cpp -o primes
- $ ./primes
-
-Language overview
-=================
+# Language overview
The original specification can be found in `Specification.txt`, and was
initially conceived by my colleagues and dear friends Alessandro Barenghi,
Michele Tartara and Nicola Vitucci, to whom goes my gratitude.
-Unfortunately, their proposal was meant to be a joke and is not complete.
+Their proposal was meant to be an elaborate joke and is not complete.
This project is an ongoing effort to produce a rigorous specification for the
language and implement a compiler, which implies filling gaps and ambiguities
with sensible choices.
@@ -121,13 +129,13 @@ Accented letters can be replaced by the non-accented letter followed by a
backtick `` ` ``, although the use of the correct Italian spelling is strongly
encouraged for maximizing the antani effect.
-###Get started!
+## Getting started real quick
+
For those of you who want to get to the code ASAP, the `examples/`
folder contains a set of programs covering most of the features of the language.
-Main
-----
+## Main
The entry point of the program (the "main") is identified by the phrase:
@@ -143,8 +151,8 @@ optionally, no value might be returned with:
vaffanzum!
-Expressions
------------
+## Expressions
+
The usual operators are given, but spelled as words to best fit in sentences.
They are directly mapped on usual operators as follows:
@@ -165,7 +173,7 @@ When evaluating binary expressions whose operands have different types,
the type of the result will be the less restrictive between the two.
This ensures that no loss takes place when evaluating an expression.
-###Binary shift
+## Binary shift
Binary shift operators have a slighly different
syntax:
@@ -190,10 +198,9 @@ maps to `antani << 2`.
It goes without saying, other expression can be used instead of numbers.
Also, the usual precedence rules apply.
-**Braces are not implemented**.
+**There is no syntax for braces in Monicelli**.
-Variables
----------
+## Variables
A variable name can contain numbers, upper and lower case character and must
not start with a number (the usual rules, that's it).
@@ -206,7 +213,7 @@ to the same variable.
Consequently, the articles above cannot be used as variable names.
-###Assignment
+## Assignment
A value can be assigned to a variable with the following statement:
@@ -218,7 +225,7 @@ The `` initializer is casted to the declared type of the variable,
even if the cast will cause some loss. This feature can be (ab)used to introduce
C-style casts too.
-###Declaration
+## Declaration
Variables can be declared in any scope. There are 5 variable types, which are
directly mapped on C++/C99 types as follows:
@@ -246,8 +253,7 @@ for instance:
declares a variables called `antani` of type `Necchi` (`int`) and initializes
it to 4.
-Input/Output
-------------
+## Input/Output
Variables and expressions can be printed with the statement:
@@ -257,8 +263,7 @@ Conversely, a variable might be read from input using:
mi porga
-Loop
-----
+## Loop
There is only one loop construct, equivalent to a C `do {} while();`, which is
defined as follows:
@@ -283,8 +288,7 @@ maps to:
`brematura` might be replaced by its alternate form `prematura`
-Branch
-------
+## Branch
The branch construct encompasses both the features of an `if` and a `switch`.
The best way to explain it is by comparing its various forms to the corresponding
@@ -358,13 +362,12 @@ Finally, here is the equivalent of a `switch () {}`:
where the `o tarapia tapioco` part is like the `default` block.
-Functions
----------
+## Functions
**Note**: the alternate spelling `supercazzora` might be used in place
of `supercazzola` wherever the latter appears.
-###Declaration
+## Declaration
A function is declared with the `blinda la supercazzola` statement:
@@ -404,7 +407,11 @@ Functions cannot be nested and can be declared before or after the main in any
order. `mcc` will not check that a return statement is always reachable inside
a non-void function. Failing to return a value leads to undefined behaviour.
-###Invocation
+A function might be declared with no body, in which case it's treated as a
+prototype. A prototype makes the function signature known to the compiler, and
+it signals that the function is implemented in another file.
+
+## Invocation
A function is called with the `brematurata la supercazzola` statement:
@@ -418,8 +425,7 @@ maps to:
antani = alfio(barilotto / 3) * 2;
-Exceptions
-----------
+## Exceptions
The program might be aborted immediately with the statement:
@@ -427,16 +433,14 @@ The program might be aborted immediately with the statement:
there are no arguments.
-Assertions
-----------
+## Assertions
An assertion block will evaluate its expression and trigger an error message
if it is found to be 0 (logical false). An assertion is stated as:
ho visto !
-Comments
---------
+## Comments
Any character after `bituma` is ignored until a line break is encountered. For
instance, in:
@@ -448,7 +452,7 @@ instance, in:
Comments are useful to fill the "supercazzola" and make it more readable, since
any word (including reserved words) can be inserted into it.
-###Meta comments
+## Meta comments
In addition to line comments, there are meta comments. A meta comment starts
with an hash sign `#` and continues until a line break is encountered, as an
@@ -459,10 +463,11 @@ a long "supercazzola". Also, ordinary comments can and should be used in an
improper way to fill the sentence, meta comments provide a mechanism for
distiguishing "real" comments.
-Reserved words and phrases
-------------------------
+## Reserved words and phrases
-The following phrases are currently reserved with no assigned usage. They cannot be used as variable identifiers, even if they do not serve any other purpose in the current language revision.
+The following phrases are currently reserved with no assigned usage. They cannot
+be used as variable identifiers, even if they do not serve any other purpose in
+the current language revision.
* `conte`
* `scusi noi siamo in`
diff --git a/cmake/FindLLVM.cmake b/cmake/FindLLVM.cmake
new file mode 100644
index 0000000..73e497d
--- /dev/null
+++ b/cmake/FindLLVM.cmake
@@ -0,0 +1,54 @@
+# Copyright 2017 the Monicelli project authors. All rights reserved.
+# Use of this source code is governed by a GPLv3 license, see LICENSE.txt.
+
+find_program(LLVM_CONFIG llvm-config)
+
+if (LLVM_CONFIG STREQUAL "LLVM_CONFIG-NOTFOUND")
+ message(FATAL_ERROR "Please install the LLVM dev package to compile Monicelli.")
+else()
+ message(STATUS "Found llvm-config: ${LLVM_CONFIG}")
+endif()
+
+execute_process(
+ COMMAND ${LLVM_CONFIG} --version
+ OUTPUT_VARIABLE LLVM_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+set(TARGET_LLVM_VERSION "3.8.0")
+
+if (NOT LLVM_VERSION STREQUAL ${TARGET_LLVM_VERSION})
+ message(WARNING "Expected LLVM ${TARGET_LLVM_VERSION}, found ${LLVM_VERSION}, build may fail.")
+endif()
+
+execute_process(
+ COMMAND ${LLVM_CONFIG} --includedir
+ OUTPUT_VARIABLE LLVM_INCLUDE_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+execute_process(
+ COMMAND ${LLVM_CONFIG} --libdir
+ OUTPUT_VARIABLE LLVM_LIBRARY_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+execute_process(
+ COMMAND ${LLVM_CONFIG} --cxxflags
+ OUTPUT_VARIABLE LLVM_CXXFLAGS
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+execute_process(
+ COMMAND ${LLVM_CONFIG} --libs all
+ OUTPUT_VARIABLE LLVM_MODULE_LIBS
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+execute_process(
+ COMMAND ${LLVM_CONFIG} --system-libs
+ OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+set(LLVM_LIBS ${LLVM_MODULE_LIBS} ${LLVM_SYSTEM_LIBS})
diff --git a/cmake/FindRagel.cmake b/cmake/FindRagel.cmake
new file mode 100644
index 0000000..d50216e
--- /dev/null
+++ b/cmake/FindRagel.cmake
@@ -0,0 +1,10 @@
+# Copyright 2017 the Monicelli project authors. All rights reserved.
+# Use of this source code is governed by a GPLv3 license, see LICENSE.txt.
+
+find_program(RAGEL ragel)
+
+if (${RAGEL} STREQUAL "RAGEL-NOTFOUND")
+ message(FATAL_ERROR "Please install ragel to compile Monicelli.")
+else()
+ message(STATUS "Found ragel: ${RAGEL}")
+endif()
diff --git a/cmake/bison2.patch b/cmake/bison2.patch
deleted file mode 100644
index 523e805..0000000
--- a/cmake/bison2.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/Monicelli.ypp b/Monicelli.ypp
-index 028506d..9817f1e 100644
---- a/Monicelli.ypp
-+++ b/Monicelli.ypp
-@@ -23,7 +23,7 @@
- }
-
- %skeleton "lalr1.cc"
--%require "3.0"
-+%require "2.5"
- %language "c++"
-
- %defines
-@@ -31,9 +31,11 @@
- %locations
- %token-table
-
--%define parse.error verbose
--%define api.namespace {monicelli}
--%define parser_class_name {Parser}
-+%{
-+#define YYERROR_VERBOSE
-+%}
-+%define namespace monicelli
-+%define parser_class_name Parser
-
- %lex-param {Scanner &scanner}
- %parse-param {Scanner &scanner}
diff --git a/cmake/features.cpp b/cmake/features.cpp
deleted file mode 100644
index e28e8e6..0000000
--- a/cmake/features.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Monicelli: an esoteric language compiler
- *
- * Copyright (C) 2014 Stefano Sanfilippo
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * Minimum program containing all required C++11 features.
- * If a compiler cannot compile this, then it won't compile Monicelli.
- */
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-
-const int global_i = 0;
-
-template
-using Foo = std::vector;
-
-struct TestingReferenceBinding {
- TestingReferenceBinding(int const& ii) {
- assert(&ii == &global_i);
- }
-
- void operator=(int const& ii) {
- assert(&ii == &global_i);
- }
-
- void operator=(int&&) {
- assert(false);
- }
-};
-
-enum class Dummy {
- FOO, BAR, BAZ
-};
-
-class Banana {
- int yep() const noexcept {
- return 0;
- }
-
- virtual void something() {}
-};
-
-class Phone: public Banana {
- virtual void something() override {}
-};
-
-int main() {
- std::unique_ptr foo(new int{0});
- std::vector bar = {1, 2, 3};
- for (int baz: bar) {
- baz += 1;
- }
- char *str = nullptr;
- Banana a;
- Banana b = std::move(a);
- long c = std::stol("100");
-
- // Boost::Optional sanity check for old compilers
- int const& iref = global_i;
- assert(&iref == &global_i);
-
- TestingReferenceBinding ttt = global_i;
- ttt = global_i;
-
- TestingReferenceBinding ttt2 = iref;
- ttt2 = iref;
-}
diff --git a/cmake/macosx_homebrew.cmake b/cmake/macosx_homebrew.cmake
deleted file mode 100644
index 947d335..0000000
--- a/cmake/macosx_homebrew.cmake
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# Monicelli: an esoteric language compiler
-#
-# Copyright (C) 2014 Stefano Sanfilippo
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-
-# The following macro has been adapted from
-# https://gist.github.com/steakknife/c36c99b51703fc6f6c1b
-
-# If is running under Mac OS X and the Homebrew package manager is installed,
-# then Homebrew-specific directories for the given package are automatically
-# added to the appropriate CMake search paths.
-
-macro(find_package_prefer_brew _package)
- unset(_brew_path)
- unset(_brew_pkg_lower)
- unset(_has_brew)
- find_program(_has_brew NAMES brew DOC "path to Homebrew executable")
- if(_has_brew)
- string(TOLOWER ${_package} _brew_pkg_lower)
- execute_process(COMMAND brew --prefix ${_brew_pkg_lower} ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE _brew_path)
- if(EXISTS ${_brew_path})
- set(_brew_cmake_module_path ${CMAKE_MODULE_PATH})
- set(_brew_cmake_program_path ${CMAKE_PROGRAM_PATH})
- set(_brew_cmake_include_path ${CMAKE_INCLUDE_PATH})
- set(_brew_cmake_library_path ${CMAKE_LIBRARY_PATH})
-
- if(NOT CMAKE_MODULE_PATH)
- list(INSERT CMAKE_MODULE_PATH 0 "${_brew_path}")
- endif()
-
- if(NOT CMAKE_PROGRAM_PATH AND EXISTS "${_brew_path}/bin")
- list(INSERT CMAKE_PROGRAM_PATH 0 "${_brew_path}/bin")
- endif()
-
- if(NOT CMAKE_INCLUDE_PATH AND EXISTS "${_brew_path}/include")
- list(INSERT CMAKE_INCLUDE_PATH 0 "${_brew_path}/include")
- endif()
-
- if(NOT CMAKE_LIBRARY_PATH AND EXISTS "${_brew_path}/lib")
- list(INSERT CMAKE_LIBRARY_PATH 0 "${_brew_path}/lib")
- endif()
-
- find_package(${_package} ${ARGN})
-
- set(CMAKE_MODULE_PATH ${_brew_cmake_module_path})
- set(CMAKE_PROGRAM_PATH ${_brew_cmake_program_path})
- set(CMAKE_INCLUDE_PATH ${_brew_cmake_include_path})
- set(CMAKE_LIBRARY_PATH ${_brew_cmake_library_path})
-
- unset(_brew_cmake_module_path)
- unset(_brew_cmake_program_path)
- unset(_brew_cmake_include_path)
- unset(_brew_cmake_library_path)
- else()
- find_package(${_package} ${ARGN})
- endif()
- else()
- find_package(${_package} ${ARGN})
- endif()
-endmacro(find_package_prefer_brew)
diff --git a/cmake/package.cmake b/cmake/package.cmake
deleted file mode 100644
index 747141f..0000000
--- a/cmake/package.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Monicelli: an esoteric language compiler
-#
-# Copyright (C) 2014 Stefano Sanfilippo
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-
-include(InstallRequiredSystemLibraries)
-
-set(CPACK_GENERATOR "TGZ;DEB;RPM;ZIP")
-
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
- "Monicelli: an esoteric programming language, come se fosse antani."
-)
-set(CPACK_PACKAGE_VENDOR "Stefano Sanfilippo")
-set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Stefano Sanfilippo")
-
-set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
-
-set(CPACK_PACKAGE_VERSION_MAJOR "1")
-set(CPACK_PACKAGE_VERSION_MINOR "0")
-set(CPACK_PACKAGE_VERSION_PATCH "0")
-
-set(CPACK_PACKAGE_INSTALL_DIRECTORY
- "monicelli-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}"
-)
-
-include(CPack)
-
diff --git a/examples/Makefile b/examples/Makefile
new file mode 100644
index 0000000..6b9ecee
--- /dev/null
+++ b/examples/Makefile
@@ -0,0 +1,10 @@
+MCC=mcc
+EXAMPLES=factorial hello-world primes return fibonacci mandelbrot float
+
+all: $(EXAMPLES)
+
+clean:
+ $(RM) $(EXAMPLES)
+
+%: %.mc
+ $(MCC) $< -o $@
diff --git a/examples/turtle/.gitignore b/examples/turtle/.gitignore
deleted file mode 100644
index 959feb0..0000000
--- a/examples/turtle/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/tartaruga
-/turtle.bc
-/barilotto.png
diff --git a/examples/turtle/Makefile b/examples/turtle/Makefile
index fa8e0f3..a37875b 100644
--- a/examples/turtle/Makefile
+++ b/examples/turtle/Makefile
@@ -1,6 +1,14 @@
-compile:
- # Make sure to have mcc somewhere in path
- mcc turtle.mm turtle.mc
- llc turtle.bc
- c++ turtle.s turtle.cpp -I../.. -lcairo -o tartaruga
- rm -f turtle.s
+MCC=mcc
+
+all: turtle
+
+clean:
+ $(RM) *.o turtle
+
+turtle.mc:;
+
+%.mc.o: %.mc
+ $(MCC) -c $< -o $@
+
+turtle: turtle.mc.o turtle.cpp
+ $(CXX) -std=c++11 $^ -lcairo -o $@
diff --git a/examples/turtle/turtle.cpp b/examples/turtle/turtle.cpp
index bf7d619..1dbd454 100644
--- a/examples/turtle/turtle.cpp
+++ b/examples/turtle/turtle.cpp
@@ -1,103 +1,102 @@
-#include "Runtime.h"
-
#include
+
+#include
+#include
#include
-
-class Turtle {
+class Turtle final {
public:
- Turtle(int sizeX, int sizeY) {
- surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, sizeX, sizeY);
- context = cairo_create(surface);
- reset();
- }
+ Turtle(int sizeX, int sizeY) {
+ surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, sizeX, sizeY);
+ context = cairo_create(surface);
+ reset();
+ }
- virtual ~Turtle() {
- cairo_destroy(context);
- cairo_surface_destroy(surface);
- }
+ ~Turtle() {
+ cairo_destroy(context);
+ cairo_surface_destroy(surface);
+ }
- void reset() {
- setColor(1, 1, 1);
- paint();
- setLineWidth(3);
- setColor(1, 0, 0);
- moveTo(0, 0);
- }
+ void reset() {
+ setColor(1, 1, 1);
+ paint();
+ setLineWidth(3);
+ setColor(1, 0, 0);
+ moveTo(0, 0);
+ }
- void setColor(double r, double g, double b) {
- cairo_set_source_rgb(context, r, g, b);
- }
+ void setColor(double r, double g, double b) {
+ cairo_set_source_rgb(context, r, g, b);
+ }
- void setLineWidth(double size) {
- cairo_set_line_width(context, size);
- }
+ void setLineWidth(double size) {
+ cairo_set_line_width(context, size);
+ }
- void paint() {
- cairo_paint(context);
- }
+ void paint() {
+ cairo_paint(context);
+ }
- void moveTo(double x, double y) {
- cairo_move_to(context, x, y);
- }
+ void moveTo(double x, double y) {
+ cairo_move_to(context, x, y);
+ }
- void rectangleTo(double width, double height) {
- double baseX;
- double baseY;
+ void rectangleTo(double width, double height) {
+ double baseX;
+ double baseY;
- cairo_get_current_point(context, &baseX, &baseY);
- cairo_rectangle(context, baseX, baseY, width, height);
- cairo_fill(context);
+ cairo_get_current_point(context, &baseX, &baseY);
+ cairo_rectangle(context, baseX, baseY, width, height);
+ cairo_fill(context);
- moveTo(baseX, baseY);
- }
+ moveTo(baseX, baseY);
+ }
- void lineTo(double x, double y) {
- cairo_line_to(context, x, y);
- cairo_stroke(context);
- moveTo(x, y);
- }
+ void lineTo(double x, double y) {
+ cairo_line_to(context, x, y);
+ cairo_stroke(context);
+ moveTo(x, y);
+ }
- void save(char const* filename) {
- cairo_surface_write_to_png(surface, filename);
- }
+ void save(char const* filename) {
+ cairo_surface_write_to_png(surface, filename);
+ }
- void save(std::string const& filename) {
- save(filename.c_str());
- }
+ void save(std::string const& filename) {
+ save(filename.c_str());
+ }
private:
- cairo_surface_t *surface;
- cairo_t *context;
+ cairo_surface_t *surface;
+ cairo_t *context;
};
-static Turtle *turtle = 0;
+static std::unique_ptr turtle;
extern "C" {
-void cofandina(Monicelli_Int x, Monicelli_Int y) {
- if (turtle != 0) delete turtle;
- turtle = new Turtle(x, y);
+void cofandina(int32_t x, int32_t y) {
+ turtle.reset(new Turtle(x, y));
}
-void pulitina(Monicelli_Double r, Monicelli_Double g, Monicelli_Double b) {
- turtle->setColor(r, g, b);
+void pulitina(double r, double g, double b) {
+ turtle->setColor(r, g, b);
}
-void pastene(Monicelli_Double size) {
- turtle->setLineWidth(size);
+void pastene(double size) {
+ turtle->setLineWidth(size);
}
-void muovi(Monicelli_Double x, Monicelli_Double y) {
- turtle->moveTo(x, y);
+void muovi(double x, double y) {
+ turtle->moveTo(x, y);
}
-void ispettore(Monicelli_Double x, Monicelli_Double y) {
- turtle->lineTo(x, y);
+void ispettore(double x, double y) {
+ turtle->lineTo(x, y);
}
void barilotto() {
- turtle->save("barilotto.png");
+ turtle->save("barilotto.png");
}
} // extern
diff --git a/examples/turtle/turtle.mc b/examples/turtle/turtle.mc
index 5d450bf..d8c04f9 100644
--- a/examples/turtle/turtle.mc
+++ b/examples/turtle/turtle.mc
@@ -1,3 +1,8 @@
+blinda la supercazzola cofandina con x Necchi, y Necchi o scherziamo?
+blinda la supercazzola pastene con w Sassaroli o scherziamo?
+blinda la supercazzola ispettore con x Sassaroli, y Sassaroli o scherziamo?
+blinda la supercazzola barilotto o scherziamo?
+
Lei ha clacsonato
prematurata la supercazzola cofandina con 200, 200 o scherziamo?
prematurata la supercazzola pastene con 3 o scherziamo?
diff --git a/examples/turtle/turtle.mm b/examples/turtle/turtle.mm
deleted file mode 100644
index 6ebdffd..0000000
--- a/examples/turtle/turtle.mm
+++ /dev/null
@@ -1,26 +0,0 @@
-help:
- Turtle graphics in Monicelli!
-
-source:
- - Turtle.cpp
-
-functions:
- cofandina:
- args: {x: int, y: int}
- type: void
- help: Crea una superficie di x per y pixel.
- pulitina:
- args: {r: double, g: double, b: double}
- help: Imposta il colore dell'output.
- pastene:
- args: {size: double}
- help: Imposta la dimensione in pixel della penna.
- muovi:
- args: {x: double, y: double}
- help: Porta la penna nel punto specificato.
- ispettore:
- args: {x: double, y: double}
- help: Traccia una linea dal punto corrente al punto specificato.
- barilotto:
- docs: Salva l'immagine come barilotto.png
-
diff --git a/src/BitcodeEmitter.cpp b/src/BitcodeEmitter.cpp
deleted file mode 100644
index 5a4f695..0000000
--- a/src/BitcodeEmitter.cpp
+++ /dev/null
@@ -1,796 +0,0 @@
-/*
- * Monicelli: an esoteric language compiler
- *
- * Copyright (C) 2014 Stefano Sanfilippo
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "BitcodeEmitter.hpp"
-#include "Scope.hpp"
-#include "Nodes.hpp"
-#include "ModuleRegistry.hpp"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include