Permalink
Browse files

Add notes for Ruby Ireland talk on ANTLR.

  • Loading branch information...
Ana Nelson Ana Nelson
Ana Nelson authored and Ana Nelson committed Jun 15, 2010
1 parent 32c3fd5 commit 5e20a96189d4296f95a1f81bafe2c44d8085687a
View
@@ -18,6 +18,7 @@ pkg
.bzr
.bzrignore
examples
+debug-examples
webby
stats
spec
View
@@ -1,10 +1,9 @@
-require "lib/surpass"
+require 'rubygems'
+require 'surpass'
book = Workbook.new
sheet = book.add_sheet
-sheet.write(0, 0, "surpass #{Surpass::VERSION} running on #{RUBY_DESCRIPTION}")
-
top_align = StyleFormat.new(:text_align => 'top')
bottom_align = StyleFormat.new(:text_align => 'bottom')
View
@@ -15,6 +15,7 @@ def col
end
end
+### @export "string-cell"
class StringCell < Cell
def initialize(parent, index, format_index, sst_index)
@parent = parent
@@ -27,6 +28,7 @@ def to_biff
LabelSSTRecord.new(@parent.index, @index, @format_index, @sst_index).to_biff
end
end
+### @end
class BlankCell < Cell
def initialize(parent, index, format_index)
@@ -0,0 +1,30 @@
+What is ANTLR?
+Parser Generator
+ANother Tool for Language Recognition
+
+What would you use it for?
+- Domain Specific Languages
+- When a regular expression gets too complicated
+- When you need really robust code
+- Learning more about computer science
+
+vs. Ragel
+- Ragel better for state-machine type uses
+- ANTLR has recursion - *very* powerful and used in Excel parser
+- For many parsing tasks either will work, should try both and see which fits
+
+Targets
+- native Ruby: new target
+- Java: very well tested, the 'default' target for ANTLR, use via JRuby
+- C: For performance/compactness if you don't need JRuby compatibility and you don't mind C
+- C# on CLR maybe?
+
+Native Ruby Target
+http://ohboyohboyohboy.github.com/antlr3/
+
+Surpass
+- Create Excel spreadsheets using just Ruby - no need to have Microsoft Office or Windows
+- We write the .xls files directly
+- Microsoft file formats are pretty nasty!
+- This is why we need a parser!!
+
@@ -0,0 +1,15 @@
+---
+title: ANTLR for Ruby
+subtitle: Excel Formula Generation
+author: Ana Nelson
+created_at: 2010-06-15
+layout: beamer
+filter:
+ - erb
+---
+
+
+\begin{frame}[fragile]
+<%= gorgl("../lib/surpass/cell.rb", "string-cell") %>
+\end{frame}
+
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,32 @@
+---
+extension: tex
+filter: erb
+---
+\documentclass{beamer}
+\usetheme{Boadilla}
+
+\usepackage{fancyvrb}
+\usepackage{color}
+\usepackage[ascii]{inputenc}
+\usepackage{hyperref}
+\usepackage{wrapfig}
+\usepackage{multicol}
+
+<%= pygments_latex_styles %>
+
+
+\title{<%= @page.title %>}
+\subtitle{<%= @page.subtitle %>}
+\author{<%= @page.author %>}
+\date[<%= @page.created_at.strftime("%B %Y") %>]{<%= @page.created_at.strftime("%d %b %Y") %>}
+
+\begin{document}
+
+\begin{frame}[plain]
+\titlepage
+\end{frame}
+
+
+<%= @content %>
+
+\end{document}

0 comments on commit 5e20a96

Please sign in to comment.