Skip to content
Browse files

+ Benchmarking has moved into parslet-benchmarks

  • Loading branch information...
1 parent 5529d75 commit cbb8da9eafbf7b168963c766b573ac5af8c7e1bd @kschiess committed
View
158 experiments/ansi_smalltalk.citrus
@@ -1,158 +0,0 @@
-grammar AnsiSmalltalk
- rule root
- (statements)
- end
- rule statements
- ((expressions) (separator_p) ("^" (expression) "."0*1)0*1)
- end
- rule expressions
- (((expression) ".")0* (expression)0*1)
- end
- rule separator_p
- (separator)0*1
- end
- rule expression
- ((assignment_expression) | (normal_expression))
- end
- rule separator
- ((comment) | (space))1*
- end
- rule assignment_expression
- ((separator_p) (assignment) (normal_expression))
- end
- rule normal_expression
- ((separator_p) ((cascaded_message_expression) | (message_expression) | (primary)) (separator_p))
- end
- rule comment
- ("\"" ("\"\"" | (!"\"" .))0* "\"")
- end
- rule space
- [\s]1*
- end
- rule assignment
- ((variable_name) (separator_p) (":=" | "_"))
- end
- rule cascaded_message_expression
- ((message_expression) (";" (separator_p) (message_send))1*)
- end
- rule message_expression
- ((keyword_expression) | (binary_expression) | (unary_expression))
- end
- rule primary
- ((literal) | (block) | (brace_expression) | ("(" (expression) ")") | (variable_name))
- end
- rule variable_name
- (bindable_identifier)
- end
- rule message_send
- ((keyword_send) | (binary_send) | (unary_send))
- end
- rule keyword_expression
- ((binary_object) (keyword_send))
- end
- rule binary_expression
- ((unary_object) ((separator_p) (binary_send))1*)
- end
- rule unary_expression
- ((primary) ((separator_p) (unary_send))1*)
- end
- rule literal
- ((character_constant) | (number) | (symbol_constant) | (string) | (array_constant) | (reserved_identifier))
- end
- rule block
- ("[" (separator_p) ((block_arguments)0*1 (separator_p) (code_body)) "]")
- end
- rule brace_expression
- ("{" (separator_p) ((expressions) (separator_p) (expression)0*1) (separator_p) "."0*1 (separator_p) "}")
- end
- rule bindable_identifier
- (!(reserved_identifier) (identifier))
- end
- rule keyword_send
- ((separator_p) (keyword) (separator_p) (binary_object))1*
- end
- rule binary_send
- ((binary_selector) (separator_p) (unary_object))
- end
- rule unary_send
- ((identifier) !(":" | (letter) | (digit)))
- end
- rule binary_object
- ((binary_expression) | (unary_object))
- end
- rule unary_object
- ((unary_expression) | (primary))
- end
- rule character_constant
- ("$" .)
- end
- rule number
- ((scaled_decimal) | (float) | (integer))
- end
- rule symbol_constant
- ("#" (symbol))
- end
- rule string
- ("'" ("''" | (!"'" .))0* "'")
- end
- rule array_constant
- ("#" (array))
- end
- rule reserved_identifier
- ("true" | "false" | "nil" | "self" | "super")
- end
- rule block_arguments
- (((separator_p) ":" (variable_name) (separator_p))1* "|")
- end
- rule code_body
- ((locals)0*1 (statements))
- end
- rule identifier
- ((letter) ((letter) | (digit) | "_")0*)
- end
- rule keyword
- ((identifier) ":")
- end
- rule binary_selector
- (("-"1* | (special)) (special)0*)
- end
- rule letter
- [A-Za-z]
- end
- rule digit
- [\d]
- end
- rule scaled_decimal
- (((decimal) ("." (digit)1*)0*1) "s" (decimal))
- end
- rule float
- ((scientific_float) | (normal_float))
- end
- rule integer
- ((radix) | (decimal))
- end
- rule symbol
- ((keyword)1* | (identifier) | (binary_selector) | (string))
- end
- rule array
- ("(" (((number) | (symbol_constant) | (symbol) | (string) | (character_constant) | (array_constant) | (array)) | (separator))0* ")")
- end
- rule locals
- ("|" (separator_p) ((variable_name) (separator_p))0* "|")
- end
- rule special
- ("+" | "*" | "/" | "\\" | "~" | "<" | ">" | "=" | "@" | "%" | "&" | "?" | "!" | "`" | "," | "|")
- end
- rule decimal
- ("-"0*1 (digit)1*)
- end
- rule scientific_float
- (((normal_float) | (integer)) [edq] (integer))
- end
- rule normal_float
- ((decimal) "." (digit)1*)
- end
- rule radix
- ((decimal) "r" ((digit) | (letter))1*)
- end
-end
View
3,084 experiments/ansi_smalltalk.rb
0 additions, 3,084 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
158 experiments/ansi_smalltalk.tt
@@ -1,158 +0,0 @@
-grammar AnsiSmalltalk
- rule root
- (statements)
- end
- rule statements
- ((expressions) (separator_p) ("^" (expression) "."0..1)0..1)
- end
- rule expressions
- (((expression) ".")0.. (expression)0..1)
- end
- rule separator_p
- (separator)0..1
- end
- rule expression
- ((assignment_expression) / (normal_expression))
- end
- rule separator
- ((comment) / (space))1..
- end
- rule assignment_expression
- ((separator_p) (assignment) (normal_expression))
- end
- rule normal_expression
- ((separator_p) ((cascaded_message_expression) / (message_expression) / (primary)) (separator_p))
- end
- rule comment
- ("\"" ("\"\"" / (!"\"" .))0.. "\"")
- end
- rule space
- [\s]1..
- end
- rule assignment
- ((variable_name) (separator_p) (":=" / "_"))
- end
- rule cascaded_message_expression
- ((message_expression) (";" (separator_p) (message_send))1..)
- end
- rule message_expression
- ((keyword_expression) / (binary_expression) / (unary_expression))
- end
- rule primary
- ((literal) / (block) / (brace_expression) / ("(" (expression) ")") / (variable_name))
- end
- rule variable_name
- (bindable_identifier)
- end
- rule message_send
- ((keyword_send) / (binary_send) / (unary_send))
- end
- rule keyword_expression
- ((binary_object) (keyword_send))
- end
- rule binary_expression
- ((unary_object) ((separator_p) (binary_send))1..)
- end
- rule unary_expression
- ((primary) ((separator_p) (unary_send))1..)
- end
- rule literal
- ((character_constant) / (number) / (symbol_constant) / (string) / (array_constant) / (reserved_identifier))
- end
- rule block
- ("[" (separator_p) ((block_arguments)0..1 (separator_p) (code_body)) "]")
- end
- rule brace_expression
- ("{" (separator_p) ((expressions) (separator_p) (expression)0..1) (separator_p) "."0..1 (separator_p) "}")
- end
- rule bindable_identifier
- (!(reserved_identifier) (identifier))
- end
- rule keyword_send
- ((separator_p) (keyword) (separator_p) (binary_object))1..
- end
- rule binary_send
- ((binary_selector) (separator_p) (unary_object))
- end
- rule unary_send
- ((identifier) !(":" / (letter) / (digit)))
- end
- rule binary_object
- ((binary_expression) / (unary_object))
- end
- rule unary_object
- ((unary_expression) / (primary))
- end
- rule character_constant
- ("$" .)
- end
- rule number
- ((scaled_decimal) / (float) / (integer))
- end
- rule symbol_constant
- ("#" (symbol))
- end
- rule string
- ("'" ("''" / (!"'" .))0.. "'")
- end
- rule array_constant
- ("#" (array))
- end
- rule reserved_identifier
- ("true" / "false" / "nil" / "self" / "super")
- end
- rule block_arguments
- (((separator_p) ":" (variable_name) (separator_p))1.. "|")
- end
- rule code_body
- ((locals)0..1 (statements))
- end
- rule identifier
- ((letter) ((letter) / (digit) / "_")0..)
- end
- rule keyword
- ((identifier) ":")
- end
- rule binary_selector
- (("-"1.. / (special)) (special)0..)
- end
- rule letter
- [A-Za-z]
- end
- rule digit
- [\d]
- end
- rule scaled_decimal
- (((decimal) ("." (digit)1..)0..1) "s" (decimal))
- end
- rule float
- ((scientific_float) / (normal_float))
- end
- rule integer
- ((radix) / (decimal))
- end
- rule symbol
- ((keyword)1.. / (identifier) / (binary_selector) / (string))
- end
- rule array
- ("(" (((number) / (symbol_constant) / (symbol) / (string) / (character_constant) / (array_constant) / (array)) / (separator))0.. ")")
- end
- rule locals
- ("|" (separator_p) ((variable_name) (separator_p))0.. "|")
- end
- rule special
- ("+" / "*" / "/" / "\\" / "~" / "<" / ">" / "=" / "@" / "%" / "&" / "?" / "!" / "`" / "," / "|")
- end
- rule decimal
- ("-"0..1 (digit)1..)
- end
- rule scientific_float
- (((normal_float) / (integer)) [edq] (integer))
- end
- rule normal_float
- ((decimal) "." (digit)1..)
- end
- rule radix
- ((decimal) "r" ((digit) / (letter))1..)
- end
-end
View
4 experiments/citrus.rb
@@ -1,4 +0,0 @@
-require 'citrus'
-
-Citrus.require File.expand_path('../ansi_smalltalk', __FILE__)
-AnsiSmalltalk.parse(File.read(ARGV.first || 'test.st'))
View
22 experiments/driver.rb
@@ -1,22 +0,0 @@
-require 'benchmark'
-
-def run(lib, input_name)
- system "ruby #{lib}.rb #{input_name}"
-end
-
-def num(input)
- input.match(/\d+/)[0]
-end
-
-input_files = Dir['input/*chars.st'].sort_by { |file| num(file).to_i }
-libs = ARGV.empty? ? %w(parslet treetop) : ARGV
-
-Benchmark.bm do |bm|
- input_files.each do |input_name|
- libs.each do |lib|
- run_name = sprintf("%s-%06d", lib[0,4], num(input_name).to_i)
- bm.report(run_name) { run(lib, input_name) }
- end
- end
-end
-
View
291 experiments/export.rb
@@ -1,291 +0,0 @@
-
-$:.unshift File.dirname(__FILE__) + "/../lib"
-require 'parslet'
-
-require 'parslet/export'
-
-# A smalltalk grammar from https://github.com/rkh/Reak (R. Konstantin Haase)
-#
-class AnsiSmalltalk < Parslet::Parser
- module NamedWithDefaults
- append_features Parslet::Atoms::Named
- attr_reader :defaults
- def with(opts)
- (@default ||= {}).merge! opts
- def self.produce_return_value(*)
- @default.merge super
- end
- self
- end
- end
-
- root :statements
-
- ##
- # Allows writing
- # `foo`
- # instead of
- # str('foo')
- alias_method :`, :str
-
- ##
- # Different Smalltalk dialects support different meta data tags in different places,
- # this method helps defining them. For instance, in Squeak, you can use:
- #
- # rule(:primitive) { meta_data `primitive`, decimal }
- def meta_data(keyword, type = literal)
- `<` >> keyword >> `:` >> space? >> type >> space? >> `>`
- end
-
- ##
- # List of keywords. Dialects can easily add keywords by overriding this method.
- def keywords
- [`true`, `false`, `nil`, `self`, `super`]
- end
-
- ##
- # Smalltalk syntax definition.
- rule :space do
- match['\s'].repeat(1)
- end
-
- rule :space? do
- space.maybe
- end
-
- rule :letter do
- match['A-Za-z']
- end
-
- rule :digit do
- match['\d']
- end
-
- rule :comment do
- `"` >> (`""` | `"`.absnt? >> any).repeat >> `"`
- end
-
- rule :separator do
- (comment | space).repeat(1)
- end
-
- rule :separator? do
- separator.maybe
- end
-
- rule :reserved_identifier do
- keywords.inject(:|).as(:reserved)
- end
-
- rule :identifier do
- letter >> (letter | digit | `_`).repeat
- end
-
- rule :capital_identifier do
- match['A-Z'] >> (letter | digit).repeat
- end
-
- rule :bindable_identifier do
- reserved_identifier.absnt? >> identifier
- end
-
- rule :decimal do
- `-`.maybe >> digit.repeat(1)
- end
-
- rule :radix do
- decimal.as(:radix) >> `r` >> ((digit | letter).repeat(1)).as(:value)
- end
-
- rule :integer do
- (radix | decimal.as(:value).with(:radix => '10')).as :integer
- end
-
- rule :normal_float do
- decimal >> `.` >> digit.repeat(1)
- end
-
- rule :scientific_float do
- (normal_float | integer).as(:base) >> match['edq'] >> integer.as(:power)
- end
-
- rule :float do
- (scientific_float | (normal_float).as(:base).with(:power => '0')).as(:float)
- end
-
- rule :scaled_decimal do
- ((decimal.as(:major) >> (`.` >> digit.repeat(1).as(:minor)).maybe).as(:mantissa) >> `s` >> decimal.as(:digits)).as(:scaled_decimal)
- end
-
- rule :number do
- scaled_decimal | float | integer
- end
-
- rule :string do
- `'` >> (`''` | `'`.absnt? >> any).repeat.as(:string) >> `'`
- end
-
- rule :special do
- `+` | `*` | `/` | `\\` | `~` | `<` | `>` | `=` | `@` | `%` | `&` | `?` | `!` | `\`` | `,` | `|`
- end
-
- rule :binary_selector do
- (`-`.repeat(1) | special) >> special.repeat
- end
-
- rule :keyword do
- (identifier >> `:`).as(:keyword)
- end
-
- rule :symbol do
- (keyword.repeat(1) | identifier | binary_selector | string).as(:symbol)
- end
-
- rule :symbol_constant do
- `#` >> symbol
- end
-
- rule :character_constant do
- `$` >> any.as(:character)
- end
-
- rule :array do
- list = number | symbol_constant | symbol | string | character_constant | array_constant | array
- `(` >> (list.as(:entry) | separator).repeat.as(:array) >> `)`
- end
-
- rule :array_constant do
- `#` >> array
- end
-
- rule :literal do
- character_constant | number | symbol_constant | string | array_constant | reserved_identifier
- end
-
- rule :variable_name do
- bindable_identifier.as(:var)
- end
-
- rule :primary do
- literal | block | brace_expression | (`(` >> expression >> `)`) | variable_name
- end
-
- rule :assignment do
- variable_name >> separator? >> (`:=` | `_`)
- end
-
- rule :message_expression do
- keyword_expression | binary_expression | unary_expression
- end
-
- rule :keyword_send do
- (separator? >> keyword >> separator? >> binary_object.as(:value)).repeat(1).as(:send).with(:type => :keyword).as(:call)
- end
-
- rule :keyword_expression do
- (binary_object.as(:on) >> keyword_send.as(:send).with(:type => :direct)).as(:call)
- end
-
- rule :binary_send do
- (binary_selector.as(:selector) >> separator? >> unary_object.as(:value)).as(:send).with(:type => :binary).as(:call)
- end
-
- rule :binary_expression do
- (unary_object.as(:on) >> (separator? >> binary_send).repeat(1).as(:send).with(:type => :chain)).as(:call)
- end
-
- rule :unary_send do
- (identifier.as(:selector) >> (`:` | letter | digit).absnt?).as(:send).with(:type => :unary).as(:call)
- end
-
- rule :unary_expression do
- (primary.as(:on) >> (separator? >> unary_send).repeat(1).as(:send).with(:type => :chain)).as(:call)
- end
-
- rule :binary_object do
- binary_expression | unary_object
- end
-
- rule :unary_object do
- unary_expression | primary
- end
-
- rule :message_send do
- keyword_send | binary_send | unary_send
- end
-
- rule :cascaded_message_expression do
- (message_expression.as(:on) >> (`;` >> separator? >> message_send).repeat(1).
- as(:send).with(:type => :unbalanced_cascade)).as(:call)
- end
-
- rule :brace_expression do
- `{` >> separator? >> (expressions >> separator? >> expression.maybe).as(:array) >> separator? >> `.`.maybe >> separator? >> `}`
- end
-
- rule :normal_expression do
- separator? >> (cascaded_message_expression | message_expression | primary) >> separator?
- end
-
- rule :assignment_expression do
- (separator? >> assignment.as(:target) >> normal_expression.as(:value)).as(:assign)
- end
-
- rule :expression do
- # since everything is parsed into hashes, create expr nodes to force order
- # they'll get removed later
- (assignment_expression | normal_expression).as(:expr)
- end
-
- rule :expressions do
- (expression >> `.`).repeat >> expression.maybe
- end
-
- rule :statements do
- (expressions >> separator? >> (`^` >> expression >> `.`.maybe).as(:return).as(:expr).maybe).as(:expr)
- end
-
- rule :block do
- `[` >> separator? >> (block_arguments.maybe.as(:args) >> separator? >> code_body.as(:body)).as(:closure) >> `]`
- end
-
- rule :block_arguments do
- ((separator? >> `:` >> variable_name >> separator?).repeat(1) >> `|`)
- end
-
- rule :locals do
- (`|` >> separator? >> (variable_name >> separator?).repeat >> `|`)
- end
-
- rule :code_body do
- locals.maybe.as(:locals) >> statements.as(:code)
- end
-
- rule :method_header do
- keyword_method_header | binary_method_header | unary_method_header
- end
-
- rule :keyword_method_header do
- keyword_argument >> (separator? >> keyword_argument).repeat
- end
-
- rule :keyword_argument do
- keyword >> separator? >> variable_name
- end
-
- rule :binary_method_header do
- binary_selector >> separator? >> variable_name
- end
-
- rule :unary_method_header do
- bindable_identifier
- end
-end
-
-instance = AnsiSmalltalk.new
-[['citrus', :to_citrus],
- ['tt', :to_treetop]].each do |ext, msg|
- File.open("ansi_smalltalk.#{ext}", 'w') do |f|
- f.write instance.send(msg)
- end
-end
View
33 experiments/input/1671chars.st
@@ -1,33 +0,0 @@
-[ :some | |a b c|
- "A method to illustrate some syntax"
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- (#($a #a 'a' 1 1.0) addAll: { some . 1.2e10 . 2r101 })
- do: [:each | Transcript
- show: (each class name);
- show: (each printString);
- show: ' '].
- ^ x < y
-]
-
View
6 experiments/input/185chars.st
@@ -1,6 +0,0 @@
-[ :some | |a b c|
- "A method to illustrate some syntax"
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
-]
-
View
361 experiments/input/22186chars.st
@@ -1,361 +0,0 @@
-[ :some | |a b c|
- "A method to illustrate some syntax"
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- (#($a #a 'a' 1 1.0) addAll: { some . 1.2e10 . 2r101 })
- do: [:each | Transcript
- show: (each class name);
- show: (each printString);
- show: ' '].
- ^ x < y
-]
-
View
12 experiments/input/361chars.st
@@ -1,12 +0,0 @@
-[ :some | |a b c|
- "A method to illustrate some syntax"
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- (#($a #a 'a' 1 1.0) addAll: { some . 1.2e10 . 2r101 })
- do: [:each | Transcript
- show: (each class name);
- show: (each printString);
- show: ' '].
- ^ x < y
-]
-
View
17 experiments/input/671chars.st
@@ -1,17 +0,0 @@
-[ :some | |a b c|
- "A method to illustrate some syntax"
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- (#($a #a 'a' 1 1.0) addAll: { some . 1.2e10 . 2r101 })
- do: [:each | Transcript
- show: (each class name);
- show: (each printString);
- show: ' '].
- ^ x < y
-]
-
View
163 experiments/input/9796chars.st
@@ -1,163 +0,0 @@
-[ :some | |a b c|
- "A method to illustrate some syntax"
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- (#($a #a 'a' 1 1.0) addAll: { some . 1.2e10 . 2r101 })
- do: [:each | Transcript
- show: (each class name);
- show: (each printString);
- show: ' '].
- ^ x < y
-]
-
View
361 experiments/input/test.st
@@ -1,361 +0,0 @@
-[ :some | |a b c|
- "A method to illustrate some syntax"
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- true & false not & (nil isNil) ifFalse: [self halt; yourself].
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- b := self size + super size + super class GlobalVariable.
- (#($a #a 'a' 1 1.0) addAll: { some . 1.2e10 . 2r101 })
- do: [:each | Transcript
- show: (each class name);
- show: (each printString);
- show: ' '].
- ^ x < y
-]
-
View
283 experiments/parslet.rb
@@ -1,283 +0,0 @@
-$:.unshift File.dirname(__FILE__) + "/../lib"
-require 'parslet'
-
-# A smalltalk grammar from https://github.com/rkh/Reak (R. Konstantin Haase)
-#
-class AnsiSmalltalk < Parslet::Parser
- module NamedWithDefaults
- append_features Parslet::Atoms::Named
- attr_reader :defaults
- def with(opts)
- (@default ||= {}).merge! opts
- def self.produce_return_value(*)
- @default.merge super
- end
- self
- end
- end
-
- root :statements
-
- ##
- # Allows writing
- # `foo`
- # instead of
- # str('foo')
- alias_method :`, :str
-
- ##
- # Different Smalltalk dialects support different meta data tags in different places,
- # this method helps defining them. For instance, in Squeak, you can use:
- #
- # rule(:primitive) { meta_data `primitive`, decimal }
- def meta_data(keyword, type = literal)
- `<` >> keyword >> `:` >> space? >> type >> space? >> `>`
- end
-
- ##
- # List of keywords. Dialects can easily add keywords by overriding this method.
- def keywords
- [`true`, `false`, `nil`, `self`, `super`]
- end
-
- ##
- # Smalltalk syntax definition.
- rule :space do
- match['\s'].repeat(1)
- end
-
- rule :space? do
- space.maybe
- end
-
- rule :letter do
- match['A-Za-z']
- end
-
- rule :digit do
- match['\d']
- end
-
- rule :comment do
- `"` >> (`""` | `"`.absnt? >> any).repeat >> `"`
- end
-
- rule :separator do
- (comment | space).repeat(1)
- end
-
- rule :separator? do
- separator.maybe
- end
-
- rule :reserved_identifier do
- keywords.inject(:|).as(:reserved)
- end
-
- rule :identifier do
- letter >> (letter | digit | `_`).repeat
- end
-
- rule :capital_identifier do
- match['A-Z'] >> (letter | digit).repeat
- end
-
- rule :bindable_identifier do
- reserved_identifier.absnt? >> identifier
- end
-
- rule :decimal do
- `-`.maybe >> digit.repeat(1)
- end
-
- rule :radix do
- decimal.as(:radix) >> `r` >> ((digit | letter).repeat(1)).as(:value)
- end
-
- rule :integer do
- (radix | decimal.as(:value).with(:radix => '10')).as :integer
- end
-
- rule :normal_float do
- decimal >> `.` >> digit.repeat(1)
- end
-
- rule :scientific_float do
- (normal_float | integer).as(:base) >> match['edq'] >> integer.as(:power)
- end
-
- rule :float do
- (scientific_float | (normal_float).as(:base).with(:power => '0')).as(:float)
- end
-
- rule :scaled_decimal do
- ((decimal.as(:major) >> (`.` >> digit.repeat(1).as(:minor)).maybe).as(:mantissa) >> `s` >> decimal.as(:digits)).as(:scaled_decimal)
- end
-
- rule :number do
- scaled_decimal | float | integer
- end
-
- rule :string do
- `'` >> (`''` | `'`.absnt? >> any).repeat.as(:string) >> `'`
- end
-
- rule :special do
- `+` | `*` | `/` | `\\` | `~` | `<` | `>` | `=` | `@` | `%` | `&` | `?` | `!` | `\`` | `,` | `|`
- end
-
- rule :binary_selector do
- (`-`.repeat(1) | special) >> special.repeat
- end
-
- rule :keyword do
- (identifier >> `:`).as(:keyword)
- end
-
- rule :symbol do
- (keyword.repeat(1) | identifier | binary_selector | string).as(:symbol)
- end
-
- rule :symbol_constant do
- `#` >> symbol
- end
-
- rule :character_constant do
- `$` >> any.as(:character)
- end
-
- rule :array do
- list = number | symbol_constant | symbol | string | character_constant | array_constant | array
- `(` >> (list.as(:entry) | separator).repeat.as(:array) >> `)`
- end
-
- rule :array_constant do
- `#` >> array
- end
-
- rule :literal do
- character_constant | number | symbol_constant | string | array_constant | reserved_identifier
- end
-
- rule :variable_name do
- bindable_identifier.as(:var)
- end
-
- rule :primary do
- literal | block | brace_expression | (`(` >> expression >> `)`) | variable_name
- end
-
- rule :assignment do
- variable_name >> separator? >> (`:=` | `_`)
- end
-
- rule :message_expression do
- keyword_expression | binary_expression | unary_expression
- end
-
- rule :keyword_send do
- (separator? >> keyword >> separator? >> binary_object.as(:value)).repeat(1).as(:send).with(:type => :keyword).as(:call)
- end
-
- rule :keyword_expression do
- (binary_object.as(:on) >> keyword_send.as(:send).with(:type => :direct)).as(:call)
- end
-
- rule :binary_send do
- (binary_selector.as(:selector) >> separator? >> unary_object.as(:value)).as(:send).with(:type => :binary).as(:call)
- end
-
- rule :binary_expression do
- (unary_object.as(:on) >> (separator? >> binary_send).repeat(1).as(:send).with(:type => :chain)).as(:call)
- end
-
- rule :unary_send do
- (identifier.as(:selector) >> (`:` | letter | digit).absnt?).as(:send).with(:type => :unary).as(:call)
- end
-
- rule :unary_expression do
- (primary.as(:on) >> (separator? >> unary_send).repeat(1).as(:send).with(:type => :chain)).as(:call)
- end
-
- rule :binary_object do
- binary_expression | unary_object
- end
-
- rule :unary_object do
- unary_expression | primary
- end
-
- rule :message_send do
- keyword_send | binary_send | unary_send
- end
-
- rule :cascaded_message_expression do
- (message_expression.as(:on) >> (`;` >> separator? >> message_send).repeat(1).
- as(:send).with(:type => :unbalanced_cascade)).as(:call)
- end
-
- rule :brace_expression do
- `{` >> separator? >> (expressions >> separator? >> expression.maybe).as(:array) >> separator? >> `.`.maybe >> separator? >> `}`
- end
-
- rule :normal_expression do
- separator? >> (cascaded_message_expression | message_expression | primary) >> separator?
- end
-
- rule :assignment_expression do
- (separator? >> assignment.as(:target) >> normal_expression.as(:value)).as(:assign)
- end
-
- rule :expression do
- # since everything is parsed into hashes, create expr nodes to force order
- # they'll get removed later
- (assignment_expression | normal_expression).as(:expr)
- end
-
- rule :expressions do
- (expression >> `.`).repeat >> expression.maybe
- end
-
- rule :statements do
- (expressions >> separator? >> (`^` >> expression >> `.`.maybe).as(:return).as(:expr).maybe).as(:expr)
- end
-
- rule :block do
- `[` >> separator? >> (block_arguments.maybe.as(:args) >> separator? >> code_body.as(:body)).as(:closure) >> `]`
- end
-
- rule :block_arguments do
- ((separator? >> `:` >> variable_name >> separator?).repeat(1) >> `|`)
- end
-
- rule :locals do
- (`|` >> separator? >> (variable_name >> separator?).repeat >> `|`)
- end
-
- rule :code_body do
- locals.maybe.as(:locals) >> statements.as(:code)
- end
-
- rule :method_header do
- keyword_method_header | binary_method_header | unary_method_header
- end
-
- rule :keyword_method_header do
- keyword_argument >> (separator? >> keyword_argument).repeat
- end
-
- rule :keyword_argument do
- keyword >> separator? >> variable_name
- end
-
- rule :binary_method_header do
- binary_selector >> separator? >> variable_name
- end
-
- rule :unary_method_header do
- bindable_identifier
- end
-end
-
-AnsiSmalltalk.new.parse(
- File.read(ARGV.first || 'test.st'))
View
49 experiments/ranges.rb
@@ -1,49 +0,0 @@
-require 'benchmark'
-
-# Create a larg-ish file and close the handle to it. It'll be in
-# cache, but that's to be expected for parslet as well.
-File.open('test.txt', 'w') do |f|
- 1000.times do
- f.puts "abc"*40
- end
-end
-
-def nothing; end
-
-class Position
- def initialize(source, start, length, buf)
- @source, @start, @length = source, start, length
- end
-end
-
-def read_sequentially
- File.open('test.txt') do |f|
- until f.eof?
- buf = f.read(1)
- pos = Position.new(f, f.pos, 1, buf)
- nothing if buf == 'a'
- end
- end
-end
-
-def read_chunked(blocksize=500)
- File.open('test.txt') do |f|
- until f.eof?
- buf = f.read(blocksize)
-
- # To simulate what we do in read_sequentially, we'll slice
- # the buffer up into as many 1-byte chunks as it permits.
- buf.size.times do |idx|
- pos = Position.new(f, f.pos+idx, 1, buf[idx,1])
- nothing if buf[idx,1] == 'a'
- end
- end
- end
-end
-
-Benchmark.bmbm do |bm|
- bm.report('read(1): ') { read_sequentially }
- bm.report('read(500): ') { read_chunked }
- bm.report('read(1024):') { read_chunked(1024) }
- bm.report('read(4096):') { read_chunked(4096) }
-end
View
15 experiments/treetop.rb
@@ -1,15 +0,0 @@
-
-require 'treetop'
-
-$:.unshift File.dirname(__FILE__)
-require 'ansi_smalltalk'
-
-
-parser = AnsiSmalltalkParser.new
-result = parser.parse(File.read(ARGV.first || "test.st"))
-
-if !result
- puts parser.failure_reason
- puts parser.failure_line
- puts parser.failure_column
-end

0 comments on commit cbb8da9

Please sign in to comment.
Something went wrong with that request. Please try again.