summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Gemfile8
-rw-r--r--Gemfile.lock66
-rw-r--r--README.md4
-rw-r--r--Rakefile9
-rw-r--r--doc/language.adoc10
6 files changed, 100 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 0f4ebfc..ce5a7e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
/build/
-a.out
/vendor/
+
+/doc/*.html
+/doc/*.pdf
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..40d0a36
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+source 'https://rubygems.org'
+
+gem 'asciidoctor', '~> 2.0'
+gem 'asciidoctor-pdf', '~> 2.3'
+
+gem "rake", "~> 13.3"
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 0000000..59da3dc
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,66 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ Ascii85 (2.0.1)
+ addressable (2.8.8)
+ public_suffix (>= 2.0.2, < 8.0)
+ afm (1.0.0)
+ asciidoctor (2.0.26)
+ asciidoctor-pdf (2.3.24)
+ asciidoctor (~> 2.0)
+ concurrent-ruby (~> 1.3)
+ matrix (~> 0.4)
+ prawn (~> 2.4.0)
+ prawn-icon (~> 3.0.0)
+ prawn-svg (~> 0.34.0)
+ prawn-table (~> 0.2.0)
+ prawn-templates (~> 0.1.0)
+ treetop (~> 1.6.0)
+ ttfunk (~> 1.7.0)
+ concurrent-ruby (1.3.5)
+ css_parser (1.21.1)
+ addressable
+ hashery (2.1.2)
+ matrix (0.4.3)
+ pdf-core (0.9.0)
+ pdf-reader (2.15.0)
+ Ascii85 (>= 1.0, < 3.0, != 2.0.0)
+ afm (>= 0.2.1, < 2)
+ hashery (~> 2.0)
+ ruby-rc4
+ ttfunk
+ polyglot (0.3.5)
+ prawn (2.4.0)
+ pdf-core (~> 0.9.0)
+ ttfunk (~> 1.7)
+ prawn-icon (3.0.0)
+ prawn (>= 1.1.0, < 3.0.0)
+ prawn-svg (0.34.2)
+ css_parser (~> 1.6)
+ matrix (~> 0.4.2)
+ prawn (>= 0.11.1, < 3)
+ rexml (~> 3.2)
+ prawn-table (0.2.2)
+ prawn (>= 1.3.0, < 3.0.0)
+ prawn-templates (0.1.2)
+ pdf-reader (~> 2.0)
+ prawn (~> 2.2)
+ public_suffix (7.0.0)
+ rake (13.3.1)
+ rexml (3.4.4)
+ ruby-rc4 (0.1.5)
+ treetop (1.6.18)
+ polyglot (~> 0.3)
+ ttfunk (1.7.0)
+
+PLATFORMS
+ ruby
+ x86_64-linux
+
+DEPENDENCIES
+ asciidoctor (~> 2.0)
+ asciidoctor-pdf (~> 2.3)
+ rake (~> 13.3)
+
+BUNDLED WITH
+ 2.6.9
diff --git a/README.md b/README.md
index b2fdf0a..0cb7a15 100644
--- a/README.md
+++ b/README.md
@@ -9,3 +9,7 @@ representation for a such high-level hypothetical programming language.
## File extension
.elna
+
+## Supported architectures
+
+- RISC-V 32 bit.
diff --git a/Rakefile b/Rakefile
index 9edd271..da58e7c 100644
--- a/Rakefile
+++ b/Rakefile
@@ -6,6 +6,7 @@
require 'open3'
require 'pathname'
require 'rake/clean'
+require 'asciidoctor-pdf'
STAGES = Dir.glob('boot/stage*')
.collect { |stage| File.basename stage }
@@ -13,6 +14,7 @@ STAGES = Dir.glob('boot/stage*')
.drop(1) # First assembly stage does not count.
CLEAN.include 'build/boot', 'build/valid'
+CLEAN.include 'doc/*.pdf'
def compile(*arguments)
sh(ENV.fetch('CC', 'gcc'), '-fpie', '-g', *arguments)
@@ -126,3 +128,10 @@ file 'build/boot/stage1/cl' => ['build/boot/stage1', 'boot/stage1.s'] do |t|
compile('-nostdlib', '-o', t.name, *source)
end
+
+rule '.pdf' => '.adoc' do |t|
+ Asciidoctor.convert_file t.source, backend: 'pdf', safe: :safe
+end
+
+desc 'Generate documentation'
+task doc: 'doc/language.pdf'
diff --git a/doc/language.adoc b/doc/language.adoc
new file mode 100644
index 0000000..53b42e4
--- /dev/null
+++ b/doc/language.adoc
@@ -0,0 +1,10 @@
+= The programming language Elna
+:toc:
+
+== Introduction
+
+Elna is a simple, imperative, low-level programming language.
+
+It is intendet to accompany other languages in the areas, where a high-level
+language doesn't fit well. It is also supposed to be an intermediate
+representation for a such high-level hypothetical programming language.