Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add source files to website content.

  • Loading branch information...
commit 97092337afb3ceaa92f66c5f210225d9966e37de 1 parent 05a39f6
Ana Nelson authored
Showing with 530 additions and 180 deletions.
  1. +1 −0  .bzrignore
  2. +1 −1  Rakefile
  3. +6 −7 lib/ExcelFormula.g
  4. +56 −56 lib/ExcelFormulaLexer.rb
  5. +43 −43 lib/ExcelFormulaParser.rb
  6. +0 −72 lib/ExcelFormula__.g
  7. +1 −1  spec/excel_formula_spec.rb
  8. BIN  surpass-manual-0-0-5.pdf
  9. +279 −0 webby/content/css/style.css
  10. BIN  webby/content/img/Thumbs.db
  11. BIN  webby/content/img/bg_menu.gif
  12. BIN  webby/content/img/bg_t.gif
  13. BIN  webby/content/img/bullet.gif
  14. BIN  webby/content/img/logo.png
  15. BIN  webby/content/img/logo_.jpg
  16. BIN  webby/content/img/top_bg.gif
  17. BIN  webby/content/img/top_bg_.gif
  18. +24 −0 webby/content/installation/index.txt
  19. +7 −0 webby/content/source/ExcelFormulaLexer.txt
  20. +7 −0 webby/content/source/ExcelFormulaParser.txt
  21. +7 −0 webby/content/source/biff_record.txt
  22. +7 −0 webby/content/source/bitmap.txt
  23. +7 −0 webby/content/source/cell.txt
  24. +7 −0 webby/content/source/chart.txt
  25. +7 −0 webby/content/source/column.txt
  26. +7 −0 webby/content/source/document.txt
  27. +7 −0 webby/content/source/excel_formula.txt
  28. +7 −0 webby/content/source/excel_magic.txt
  29. +7 −0 webby/content/source/formatting.txt
  30. +7 −0 webby/content/source/row.txt
  31. +7 −0 webby/content/source/style.txt
  32. +7 −0 webby/content/source/surpass.txt
  33. +7 −0 webby/content/source/utilities.txt
  34. +7 −0 webby/content/source/workbook.txt
  35. +7 −0 webby/content/source/worksheet.txt
View
1  .bzrignore
@@ -2,3 +2,4 @@ spec/output/*
examples/*.xls
pkg/
webby/output
+.DS_Store
View
2  Rakefile
@@ -29,7 +29,7 @@ PROJ.ignore_file = '.bzrignore'
PROJ.spec.opts << '--color'
-PROJ.exclude = %w{.bzr webby surpass-manual-* examples spec tasks stats .DS_Store}
+PROJ.exclude = %w{.bzr webby surpass-manual-* examples spec tasks stats .DS_Store ._*}
desc "Run all examples (except the big ones) in examples dir."
task :examples do
View
13 lib/ExcelFormula.g
@@ -28,13 +28,12 @@ expr[arg_type]
(
(
EQ { op = [PTGEQ].pack('C') }
-
-/* | NE { op = [PTGNE].pack('C') }
- | GT { op = [PTGGT].pack('C') }
- | LT { op = [PTGLT].pack('C') }
- | GE { op = [PTGGE].pack('C') }
- | LE { op = [PTGLE].pack('C') }*/
-
+/* | NE { op = [PTGNE].pack('C') } */
+/* | GT { op = [PTGGT].pack('C') } */
+/* | LT { op = [PTGLT].pack('C') } */
+/* | GE { op = [PTGGE].pack('C') } */
+/* | LE { op = [PTGLE].pack('C') } */
+
)
prec0_expr[arg_type] { @rpn += op }
)*
View
112 lib/ExcelFormulaLexer.rb
@@ -1,5 +1,5 @@
-# ExcelFormulaLexer (lib/ExcelFormula.g)
-# Generated by ANTLR 3.1.2-2008-10-21 on 2009-03-30 00:49:44
+# ExcelFormulaLexer (ExcelFormula.g)
+# Generated by ANTLR 3.1.2-2008-10-21 on 2009-06-15 23:03:59
class ExcelFormulaLexer
require 'stringio'
@@ -186,7 +186,7 @@ def match_range(from, to)
def match_EQ()
- # 333:5: '='
+ # 332:5: '='
match(?=)
end
@@ -195,7 +195,7 @@ def match_LT()
@type = :LT
@type_int = LT
- # 334:5: '<'
+ # 333:5: '<'
match(?<)
end
@@ -203,7 +203,7 @@ def match_GT()
@type = :GT
@type_int = GT
- # 335:5: '>'
+ # 334:5: '>'
match(?>)
end
@@ -211,7 +211,7 @@ def match_NE()
@type = :NE
@type_int = NE
- # 336:5: '<>'
+ # 335:5: '<>'
match("<>")
end
@@ -220,7 +220,7 @@ def match_LE()
@type = :LE
@type_int = LE
- # 337:5: '<='
+ # 336:5: '<='
match("<=")
end
@@ -229,7 +229,7 @@ def match_GE()
@type = :GE
@type_int = GE
- # 338:5: '>='
+ # 337:5: '>='
match(">=")
end
@@ -238,7 +238,7 @@ def match_ADD()
@type = :ADD
@type_int = ADD
- # 340:6: '+'
+ # 339:6: '+'
match(?+)
end
@@ -246,7 +246,7 @@ def match_SUB()
@type = :SUB
@type_int = SUB
- # 341:6: '-'
+ # 340:6: '-'
match(?-)
end
@@ -254,7 +254,7 @@ def match_MUL()
@type = :MUL
@type_int = MUL
- # 342:6: '*'
+ # 341:6: '*'
match(?*)
end
@@ -262,7 +262,7 @@ def match_DIV()
@type = :DIV
@type_int = DIV
- # 343:6: '/'
+ # 342:6: '/'
match(?/)
end
@@ -270,7 +270,7 @@ def match_COLON()
@type = :COLON
@type_int = COLON
- # 345:8: ':'
+ # 344:8: ':'
match(?:)
end
@@ -278,7 +278,7 @@ def match_SEMICOLON()
@type = :SEMICOLON
@type_int = SEMICOLON
- # 346:12: ';'
+ # 345:12: ';'
match(?;)
end
@@ -286,7 +286,7 @@ def match_COMMA()
@type = :COMMA
@type_int = COMMA
- # 347:8: ','
+ # 346:8: ','
match(?,)
end
@@ -294,7 +294,7 @@ def match_LP()
@type = :LP
@type_int = LP
- # 349:5: '('
+ # 348:5: '('
match(?()
end
@@ -302,7 +302,7 @@ def match_RP()
@type = :RP
@type_int = RP
- # 350:5: ')'
+ # 349:5: ')'
match(?))
end
@@ -310,7 +310,7 @@ def match_CONCAT()
@type = :CONCAT
@type_int = CONCAT
- # 351:9: '&'
+ # 350:9: '&'
match(?&)
end
@@ -318,7 +318,7 @@ def match_PERCENT()
@type = :PERCENT
@type_int = PERCENT
- # 352:10: '%'
+ # 351:10: '%'
match(?%)
end
@@ -326,7 +326,7 @@ def match_POWER()
@type = :POWER
@type_int = POWER
- # 353:8: '^'
+ # 352:8: '^'
match(?^)
end
@@ -334,7 +334,7 @@ def match_BANG()
@type = :BANG
@type_int = BANG
- # 354:7: '!'
+ # 353:7: '!'
match(?!)
end
@@ -342,7 +342,7 @@ def match_DIGIT()
@type = :DIGIT
@type_int = DIGIT
- # 356:8: '0' .. '9'
+ # 355:8: '0' .. '9'
match_range(?0, ?9)
end
@@ -350,8 +350,8 @@ def match_INT_CONST()
@type = :INT_CONST
@type_int = INT_CONST
- # 358:12: ( DIGIT )+
- # 358:12: ( DIGIT )+
+ # 357:12: ( DIGIT )+
+ # 357:12: ( DIGIT )+
matchedOnce1 = false
while true
alt1 = 2
@@ -363,7 +363,7 @@ def match_INT_CONST()
end
case alt1
when 1
- # 358:12: DIGIT
+ # 357:12: DIGIT
match_DIGIT()
else
break
@@ -372,7 +372,7 @@ def match_INT_CONST()
end
if !matchedOnce1
- raise "Expected at least one match: 358:12: ( DIGIT )+"
+ raise "Expected at least one match: 357:12: ( DIGIT )+"
end
end
@@ -380,8 +380,8 @@ def match_NUM_CONST()
@type = :NUM_CONST
@type_int = NUM_CONST
- # 359:12: ( DIGIT )* '.' ( DIGIT )+ ( ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+ )?
- # 359:12: ( DIGIT )*
+ # 358:12: ( DIGIT )* '.' ( DIGIT )+ ( ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+ )?
+ # 358:12: ( DIGIT )*
while true
alt2 = 2
#
@@ -392,14 +392,14 @@ def match_NUM_CONST()
end
case alt2
when 1
- # 359:12: DIGIT
+ # 358:12: DIGIT
match_DIGIT()
else
break
end
end
match(?.)
- # 359:23: ( DIGIT )+
+ # 358:23: ( DIGIT )+
matchedOnce3 = false
while true
alt3 = 2
@@ -411,7 +411,7 @@ def match_NUM_CONST()
end
case alt3
when 1
- # 359:23: DIGIT
+ # 358:23: DIGIT
match_DIGIT()
else
break
@@ -420,9 +420,9 @@ def match_NUM_CONST()
end
if !matchedOnce3
- raise "Expected at least one match: 359:23: ( DIGIT )+"
+ raise "Expected at least one match: 358:23: ( DIGIT )+"
end
- # 359:30: ( ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+ )?
+ # 358:30: ( ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+ )?
alt6 = 2
#
look_ahead6_0 = @input.look_ahead(1)
@@ -433,13 +433,13 @@ def match_NUM_CONST()
end
case alt6
when 1
- # 359:31: ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+
+ # 358:31: ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+
if @input.look_ahead(1) == ?E || @input.look_ahead(1) == ?e
match()
else
raise "Expected set"
end
- # 359:41: ( '+' | '-' )?
+ # 358:41: ( '+' | '-' )?
alt4 = 2
#
look_ahead4_0 = @input.look_ahead(1)
@@ -457,7 +457,7 @@ def match_NUM_CONST()
raise "Expected set"
end
end
- # 359:52: ( DIGIT )+
+ # 358:52: ( DIGIT )+
matchedOnce5 = false
while true
alt5 = 2
@@ -469,7 +469,7 @@ def match_NUM_CONST()
end
case alt5
when 1
- # 359:52: DIGIT
+ # 358:52: DIGIT
match_DIGIT()
else
break
@@ -478,7 +478,7 @@ def match_NUM_CONST()
end
if !matchedOnce5
- raise "Expected at least one match: 359:52: ( DIGIT )+"
+ raise "Expected at least one match: 358:52: ( DIGIT )+"
end
end
end
@@ -487,7 +487,7 @@ def match_STR_CONST()
@type = :STR_CONST
@type_int = STR_CONST
- # 360:12: '\"' ~ '\"' '\"'
+ # 359:12: '\"' ~ '\"' '\"'
match(?")
if (@input.look_ahead(1) >= 0x0000 && @input.look_ahead(1) <= ?!) || (@input.look_ahead(1) >= ?# && @input.look_ahead(1) <= 0x00FF)
match()
@@ -501,8 +501,8 @@ def match_REF2D()
@type = :REF2D
@type_int = REF2D
- # 361:8: ( '$' )? ( 'A' .. 'I' )? ( 'A' .. 'Z' ) ( '$' )? ( DIGIT )+
- # 361:8: ( '$' )?
+ # 360:8: ( '$' )? ( 'A' .. 'I' )? ( 'A' .. 'Z' ) ( '$' )? ( DIGIT )+
+ # 360:8: ( '$' )?
alt7 = 2
#
look_ahead7_0 = @input.look_ahead(1)
@@ -513,10 +513,10 @@ def match_REF2D()
end
case alt7
when 1
- # 361:8: '$'
+ # 360:8: '$'
match(?$)
end
- # 361:13: ( 'A' .. 'I' )?
+ # 360:13: ( 'A' .. 'I' )?
alt8 = 2
#
look_ahead8_0 = @input.look_ahead(1)
@@ -533,12 +533,12 @@ def match_REF2D()
end
case alt8
when 1
- # 361:14: 'A' .. 'I'
+ # 360:14: 'A' .. 'I'
match_range(?A, ?I)
end
- # 361:26: 'A' .. 'Z'
+ # 360:26: 'A' .. 'Z'
match_range(?A, ?Z)
- # 361:36: ( '$' )?
+ # 360:36: ( '$' )?
alt9 = 2
#
look_ahead9_0 = @input.look_ahead(1)
@@ -549,10 +549,10 @@ def match_REF2D()
end
case alt9
when 1
- # 361:36: '$'
+ # 360:36: '$'
match(?$)
end
- # 361:41: ( DIGIT )+
+ # 360:41: ( DIGIT )+
matchedOnce10 = false
while true
alt10 = 2
@@ -564,7 +564,7 @@ def match_REF2D()
end
case alt10
when 1
- # 361:41: DIGIT
+ # 360:41: DIGIT
match_DIGIT()
else
break
@@ -573,7 +573,7 @@ def match_REF2D()
end
if !matchedOnce10
- raise "Expected at least one match: 361:41: ( DIGIT )+"
+ raise "Expected at least one match: 360:41: ( DIGIT )+"
end
end
@@ -581,7 +581,7 @@ def match_TRUE_CONST()
@type = :TRUE_CONST
@type_int = TRUE_CONST
- # 362:13: ( 'T' | 't' ) ( 'R' | 'r' ) ( 'U' | 'u' ) ( 'E' | 'e' )
+ # 361:13: ( 'T' | 't' ) ( 'R' | 'r' ) ( 'U' | 'u' ) ( 'E' | 'e' )
if @input.look_ahead(1) == ?T || @input.look_ahead(1) == ?t
match()
else
@@ -608,7 +608,7 @@ def match_FALSE_CONST()
@type = :FALSE_CONST
@type_int = FALSE_CONST
- # 363:14: ( 'F' | 'f' ) ( 'A' | 'a' ) ( 'L' | 'l' ) ( 'S' | 's' ) ( 'E' | 'e' )
+ # 362:14: ( 'F' | 'f' ) ( 'A' | 'a' ) ( 'L' | 'l' ) ( 'S' | 's' ) ( 'E' | 'e' )
if @input.look_ahead(1) == ?F || @input.look_ahead(1) == ?f
match()
else
@@ -640,7 +640,7 @@ def match_NAME()
@type = :NAME
@type_int = NAME
- # 364:7: '\\w[\\.\\w]*'
+ # 363:7: '\\w[\\.\\w]*'
match("w[.w]*")
end
@@ -649,7 +649,7 @@ def match_QUOTENAME()
@type = :QUOTENAME
@type_int = QUOTENAME
- # 365:12: '\\'(?:[^\\']|\\'\\')*\\''
+ # 364:12: '\\'(?:[^\\']|\\'\\')*\\''
match("'(?:[^']|'')*'")
end
@@ -658,7 +658,7 @@ def match_FUNC_IF()
@type = :FUNC_IF
@type_int = FUNC_IF
- # 366:10: 'IF'
+ # 365:10: 'IF'
match("IF")
end
@@ -667,7 +667,7 @@ def match_FUNC_CHOOSE()
@type = :FUNC_CHOOSE
@type_int = FUNC_CHOOSE
- # 367:14: 'CHOOSE'
+ # 366:14: 'CHOOSE'
match("CHOOSE")
end
View
86 lib/ExcelFormulaParser.rb
@@ -1,5 +1,5 @@
-# ExcelFormulaParser (lib/ExcelFormula.g)
-# Generated by ANTLR 3.1.2-2008-10-21 on 2009-03-30 00:49:44
+# ExcelFormulaParser (ExcelFormula.g)
+# Generated by ANTLR 3.1.2-2008-10-21 on 2009-06-15 23:03:59
require 'ExcelFormulaLexer' unless defined?(ExcelFormulaLexer)
@@ -117,15 +117,15 @@ def expr(arg_type)
end
- # 43:1: prec0_expr[arg_type] : prec1_expr[arg_type] ( ( CONCAT ) prec1_expr[arg_type] )* ;
+ # 42:1: prec0_expr[arg_type] : prec1_expr[arg_type] ( ( CONCAT ) prec1_expr[arg_type] )* ;
def prec0_expr(arg_type)
- # 44:7: prec1_expr[arg_type] ( ( CONCAT ) prec1_expr[arg_type] )*
+ # 43:7: prec1_expr[arg_type] ( ( CONCAT ) prec1_expr[arg_type] )*
prec1_expr(arg_type)
- # 45:9: ( ( CONCAT ) prec1_expr[arg_type] )*
+ # 44:9: ( ( CONCAT ) prec1_expr[arg_type] )*
while true
alt2 = 2
#
@@ -135,8 +135,8 @@ def prec0_expr(arg_type)
end
case alt2
when 1
- # 46:13: ( CONCAT ) prec1_expr[arg_type]
- # 47:17: CONCAT
+ # 45:13: ( CONCAT ) prec1_expr[arg_type]
+ # 46:17: CONCAT
match(:CONCAT)
op = [PTGCONCAT].pack('C')
prec1_expr(arg_type)
@@ -151,15 +151,15 @@ def prec0_expr(arg_type)
end
- # 53:1: prec1_expr[arg_type] : prec2_expr[arg_type] ( ( ADD | SUB ) prec2_expr[arg_type] )* ;
+ # 52:1: prec1_expr[arg_type] : prec2_expr[arg_type] ( ( ADD | SUB ) prec2_expr[arg_type] )* ;
def prec1_expr(arg_type)
- # 54:7: prec2_expr[arg_type] ( ( ADD | SUB ) prec2_expr[arg_type] )*
+ # 53:7: prec2_expr[arg_type] ( ( ADD | SUB ) prec2_expr[arg_type] )*
prec2_expr(arg_type)
- # 55:9: ( ( ADD | SUB ) prec2_expr[arg_type] )*
+ # 54:9: ( ( ADD | SUB ) prec2_expr[arg_type] )*
while true
alt4 = 2
#
@@ -169,8 +169,8 @@ def prec1_expr(arg_type)
end
case alt4
when 1
- # 56:13: ( ADD | SUB ) prec2_expr[arg_type]
- # 56:13: ( ADD | SUB )
+ # 55:13: ( ADD | SUB ) prec2_expr[arg_type]
+ # 55:13: ( ADD | SUB )
alt3 = 2
#
look_ahead3_0 = look_ahead(1)
@@ -183,11 +183,11 @@ def prec1_expr(arg_type)
end
case alt3
when 1
- # 57:19: ADD
+ # 56:19: ADD
match(:ADD)
op = [PTGADD].pack('C')
when 2
- # 58:19: SUB
+ # 57:19: SUB
match(:SUB)
op = [PTGSUB].pack('C')
end
@@ -203,15 +203,15 @@ def prec1_expr(arg_type)
end
- # 65:1: prec2_expr[arg_type] : prec3_expr[arg_type] ( ( MUL | DIV ) prec3_expr[arg_type] )* ;
+ # 64:1: prec2_expr[arg_type] : prec3_expr[arg_type] ( ( MUL | DIV ) prec3_expr[arg_type] )* ;
def prec2_expr(arg_type)
- # 66:7: prec3_expr[arg_type] ( ( MUL | DIV ) prec3_expr[arg_type] )*
+ # 65:7: prec3_expr[arg_type] ( ( MUL | DIV ) prec3_expr[arg_type] )*
prec3_expr(arg_type)
- # 67:9: ( ( MUL | DIV ) prec3_expr[arg_type] )*
+ # 66:9: ( ( MUL | DIV ) prec3_expr[arg_type] )*
while true
alt6 = 2
#
@@ -221,8 +221,8 @@ def prec2_expr(arg_type)
end
case alt6
when 1
- # 68:13: ( MUL | DIV ) prec3_expr[arg_type]
- # 68:13: ( MUL | DIV )
+ # 67:13: ( MUL | DIV ) prec3_expr[arg_type]
+ # 67:13: ( MUL | DIV )
alt5 = 2
#
look_ahead5_0 = look_ahead(1)
@@ -235,11 +235,11 @@ def prec2_expr(arg_type)
end
case alt5
when 1
- # 69:19: MUL
+ # 68:19: MUL
match(:MUL)
op = [PTGMUL].pack('C')
when 2
- # 70:19: DIV
+ # 69:19: DIV
match(:DIV)
op = [PTGDIV].pack('C')
end
@@ -255,15 +255,15 @@ def prec2_expr(arg_type)
end
- # 76:1: prec3_expr[arg_type] : prec5_expr[arg_type] ( ( POWER ) prec5_expr[arg_type] )* ;
+ # 75:1: prec3_expr[arg_type] : prec5_expr[arg_type] ( ( POWER ) prec5_expr[arg_type] )* ;
def prec3_expr(arg_type)
- # 77:7: prec5_expr[arg_type] ( ( POWER ) prec5_expr[arg_type] )*
+ # 76:7: prec5_expr[arg_type] ( ( POWER ) prec5_expr[arg_type] )*
prec5_expr(arg_type)
- # 78:9: ( ( POWER ) prec5_expr[arg_type] )*
+ # 77:9: ( ( POWER ) prec5_expr[arg_type] )*
while true
alt7 = 2
#
@@ -273,8 +273,8 @@ def prec3_expr(arg_type)
end
case alt7
when 1
- # 79:13: ( POWER ) prec5_expr[arg_type]
- # 80:17: POWER
+ # 78:13: ( POWER ) prec5_expr[arg_type]
+ # 79:17: POWER
match(:POWER)
op = [PTGPOWER].pack('C')
prec5_expr(arg_type)
@@ -289,15 +289,15 @@ def prec3_expr(arg_type)
end
- # 86:1: prec4_expr[arg_type] : prec5_expr[arg_type] ( PERCENT )? ;
+ # 85:1: prec4_expr[arg_type] : prec5_expr[arg_type] ( PERCENT )? ;
def prec4_expr(arg_type)
- # 87:7: prec5_expr[arg_type] ( PERCENT )?
+ # 86:7: prec5_expr[arg_type] ( PERCENT )?
prec5_expr(arg_type)
- # 88:9: ( PERCENT )?
+ # 87:9: ( PERCENT )?
alt8 = 2
#
look_ahead8_0 = look_ahead(1)
@@ -307,7 +307,7 @@ def prec4_expr(arg_type)
end
case alt8
when 1
- # 89:13: PERCENT
+ # 88:13: PERCENT
match(:PERCENT)
@rpn += [PTGPERCENT].pack('C')
end
@@ -316,12 +316,12 @@ def prec4_expr(arg_type)
end
- # 93:1: prec5_expr[arg_type] : ( primary[arg_type] | SUB primary[arg_type] );
+ # 92:1: prec5_expr[arg_type] : ( primary[arg_type] | SUB primary[arg_type] );
def prec5_expr(arg_type)
- # 94:5: ( primary[arg_type] | SUB primary[arg_type] )
+ # 93:5: ( primary[arg_type] | SUB primary[arg_type] )
alt9 = 2
#
look_ahead9_0 = look_ahead(1)
@@ -334,11 +334,11 @@ def prec5_expr(arg_type)
end
case alt9
when 1
- # 94:7: primary[arg_type]
+ # 93:7: primary[arg_type]
primary(arg_type)
when 2
- # 95:7: SUB primary[arg_type]
+ # 94:7: SUB primary[arg_type]
match(:SUB)
primary(arg_type)
@@ -349,7 +349,7 @@ def prec5_expr(arg_type)
end
- # 98:1: primary[arg_type] : ( TRUE_CONST | FALSE_CONST | str_tok= STR_CONST | int_tok= INT_CONST | num_tok= NUM_CONST | ref2d_tok= REF2D | ref2d1_tok= REF2D COLON ref2d2_tok= REF2D );
+ # 97:1: primary[arg_type] : ( TRUE_CONST | FALSE_CONST | str_tok= STR_CONST | int_tok= INT_CONST | num_tok= NUM_CONST | ref2d_tok= REF2D | ref2d1_tok= REF2D COLON ref2d2_tok= REF2D );
def primary(arg_type)
_str_tok = nil
_int_tok = nil
@@ -361,31 +361,31 @@ def primary(arg_type)
- # 99:5: ( TRUE_CONST | FALSE_CONST | str_tok= STR_CONST | int_tok= INT_CONST | num_tok= NUM_CONST | ref2d_tok= REF2D | ref2d1_tok= REF2D COLON ref2d2_tok= REF2D )
+ # 98:5: ( TRUE_CONST | FALSE_CONST | str_tok= STR_CONST | int_tok= INT_CONST | num_tok= NUM_CONST | ref2d_tok= REF2D | ref2d1_tok= REF2D COLON ref2d2_tok= REF2D )
alt10 = 7
alt10 = DFA10.predict(self, @input)
case alt10
when 1
- # 99:7: TRUE_CONST
+ # 98:7: TRUE_CONST
match(:TRUE_CONST)
@rpn += [PTGBOOL, 1].pack("C2")
when 2
- # 103:7: FALSE_CONST
+ # 102:7: FALSE_CONST
match(:FALSE_CONST)
@rpn += [PTGBOOL, 0].pack("C2")
when 3
- # 107:7: str_tok= STR_CONST
+ # 106:7: str_tok= STR_CONST
_str_tok = @input.look_ahead(1)
match(:STR_CONST)
@rpn += [PTGSTR].pack('C') + upack1(str_tok.text[1, -1]) #TODO
when 4
- # 111:7: int_tok= INT_CONST
+ # 110:7: int_tok= INT_CONST
_int_tok = @input.look_ahead(1)
match(:INT_CONST)
@@ -397,14 +397,14 @@ def primary(arg_type)
end
when 5
- # 120:7: num_tok= NUM_CONST
+ # 119:7: num_tok= NUM_CONST
_num_tok = @input.look_ahead(1)
match(:NUM_CONST)
@rpn += [ptgNum, num_tok.text.to_f].pack("CE")
when 6
- # 124:7: ref2d_tok= REF2D
+ # 123:7: ref2d_tok= REF2D
_ref2d_tok = @input.look_ahead(1)
match(:REF2D)
@@ -413,7 +413,7 @@ def primary(arg_type)
@rpn += [ptg, r, c].pack("Cv2")
when 7
- # 130:7: ref2d1_tok= REF2D COLON ref2d2_tok= REF2D
+ # 129:7: ref2d1_tok= REF2D COLON ref2d2_tok= REF2D
_ref2d1_tok = @input.look_ahead(1)
match(:REF2D)
match(:COLON)
View
72 lib/ExcelFormula__.g
@@ -1,72 +0,0 @@
-lexer grammar ExcelFormula;
-options {
- language=Ruby;
-
-}
-
-// $ANTLR src "lib/ExcelFormula.g" 332
-fragment
-EQ: '=';
-// $ANTLR src "lib/ExcelFormula.g" 334
-LT: '<';
-// $ANTLR src "lib/ExcelFormula.g" 335
-GT: '>';
-// $ANTLR src "lib/ExcelFormula.g" 336
-NE: '<>';
-// $ANTLR src "lib/ExcelFormula.g" 337
-LE: '<=';
-// $ANTLR src "lib/ExcelFormula.g" 338
-GE: '>=';
-
-// $ANTLR src "lib/ExcelFormula.g" 340
-ADD: '+';
-// $ANTLR src "lib/ExcelFormula.g" 341
-SUB: '-';
-// $ANTLR src "lib/ExcelFormula.g" 342
-MUL: '*';
-// $ANTLR src "lib/ExcelFormula.g" 343
-DIV: '/';
-
-// $ANTLR src "lib/ExcelFormula.g" 345
-COLON: ':';
-// $ANTLR src "lib/ExcelFormula.g" 346
-SEMICOLON: ';';
-// $ANTLR src "lib/ExcelFormula.g" 347
-COMMA: ',';
-
-// $ANTLR src "lib/ExcelFormula.g" 349
-LP: '(';
-// $ANTLR src "lib/ExcelFormula.g" 350
-RP: ')';
-// $ANTLR src "lib/ExcelFormula.g" 351
-CONCAT: '&';
-// $ANTLR src "lib/ExcelFormula.g" 352
-PERCENT: '%';
-// $ANTLR src "lib/ExcelFormula.g" 353
-POWER: '^';
-// $ANTLR src "lib/ExcelFormula.g" 354
-BANG: '!';
-
-// $ANTLR src "lib/ExcelFormula.g" 356
-DIGIT: '0'..'9';
-
-// $ANTLR src "lib/ExcelFormula.g" 358
-INT_CONST: DIGIT+ ;
-// $ANTLR src "lib/ExcelFormula.g" 359
-NUM_CONST: DIGIT* '.' DIGIT+ (('E'|'e') ('+'|'-')? DIGIT+)?; // \d*\.\d+(?:[Ee][+-]?\d+)?
-// $ANTLR src "lib/ExcelFormula.g" 360
-STR_CONST: '"' ~'"' '"'; // TODO add escape recognition
-// $ANTLR src "lib/ExcelFormula.g" 361
-REF2D: '$'? ('A'..'I')? ('A'..'Z') '$'? DIGIT+;
-// $ANTLR src "lib/ExcelFormula.g" 362
-TRUE_CONST: ('T'|'t') ('R'|'r') ('U'|'u') ('E'|'e') ;
-// $ANTLR src "lib/ExcelFormula.g" 363
-FALSE_CONST: ('F'|'f') ('A'|'a') ('L'|'l') ('S'|'s') ('E'|'e') ;
-// $ANTLR src "lib/ExcelFormula.g" 364
-NAME: '\w[\.\w]*' ;
-// $ANTLR src "lib/ExcelFormula.g" 365
-QUOTENAME: '\'(?:[^\']|\'\')*\'';
-// $ANTLR src "lib/ExcelFormula.g" 366
-FUNC_IF: 'IF';
-// $ANTLR src "lib/ExcelFormula.g" 367
-FUNC_CHOOSE: 'CHOOSE';
View
2  spec/excel_formula_spec.rb
@@ -20,7 +20,7 @@
it "should parse a product" do
ExcelFormula.new("TRUE*TRUE").to_biff
end
-
+
it "should raise an error if invalid formula is passed" do
lambda { ExcelFormula.new("RUBBISHXYZ") }.should raise_error
end
View
BIN  surpass-manual-0-0-5.pdf
Binary file not shown
View
279 webby/content/css/style.css
@@ -0,0 +1,279 @@
+/* ======================================================== */
+/* Created by Devit Schizoper */
+/* Created HomePages http://LoadFoo.starzonewebhost.com */
+/* Created Day 01.12.2006 */
+/* ======================================================== */
+
+
+body {
+ margin: 0px;
+ background: url(../img/top_bg.gif);
+ background-repeat: repeat-x;
+ font-family: Verdana, Arial, sans-serif;
+ font-size: .6em;
+}
+
+p {
+ line-height: 17px;
+ margin: 11px 0 10px 0;
+ padding: 0px;
+ font-size: 1.2em;
+}
+
+code {
+ font-size: 1.3em;
+}
+.code {
+ font-size: 1.3em;
+}
+
+.highlight {
+ font-size: 1.5em;
+}
+
+h2 {
+ color: #9f9f9f;
+ margin:0px;
+ padding:0px;
+ font-size: 15px;
+}
+
+ul {
+ font-size: 10px;
+ margin:0;
+ padding:0;
+ list-style-image: url(../img/bullet.gif);
+}
+
+a {
+ color: #93B300;
+}
+
+a:hover {
+ text-decoration: none;
+}
+
+blockquote{
+ background: #F7FDE3;
+ color: #606060;
+ padding: 10px;
+}
+
+
+/**** Main Container ***/
+
+
+#wrap {
+ margin-left: auto;
+ margin-right: auto;
+ width: 730px;
+}
+
+
+/**** Top ***/
+
+
+#top {
+ width: 100%;
+ height: 88px;
+ color: #fff;
+ background: #000 url(../img/top_bg.gif);
+ overflow:hidden;
+}
+
+#top h2 {
+ color: White;
+ letter-spacing: 3px;
+ font-size: 2.4em;
+ font-weight: normal;
+ position: relative;
+ margin: 0px;
+ top:33px;
+ display:block;
+ float:left;
+ background: url(../img/bg_t.gif) no-repeat;
+ padding-left: 10px;
+}
+
+#top h2 a {
+ color: white;
+ text-decoration: none;
+}
+
+#top h2 a:hover {
+ color: #93B300;
+}
+
+
+/**** Main Menu ***/
+
+
+#menu {
+ display: block;
+ float:right;
+}
+
+#menu ul {
+ margin: 0;
+ list-style: none;
+}
+
+#menu li {
+ display: block;
+ float: left;
+ white-space: nowrap;
+}
+
+#menu li a {
+ display: block;
+ padding: 55px 20px 12px 20px;
+ text-decoration: none;
+ color: #fff;
+ font-weight: bold;
+}
+
+* html #menu a {width:1%;}
+
+#menu li a:hover {
+ background: url(../img/bg_menu.gif);
+}
+
+#menu li a.current {
+ letter-spacing: 1px;
+ color: gray;
+ background: url(../img/bg_menu.gif);
+}
+
+#menu li a.current:hover {
+ color: #fff;
+}
+
+
+/**** Content Container ***/
+
+
+#content {
+ width: 100%;
+ margin-top:30px;
+}
+
+#content h2 {
+ margin: 0;
+ padding: 10px 0 10px 0;
+}
+
+
+/**** Content ***/
+
+
+#left ul {
+ padding: 15px 0 15px 35px;
+ margin:0;
+}
+
+#left li {
+ margin-bottom:5px;
+}
+
+#left {
+ width: 390px;
+ float:left;
+ display: block;
+ margin-left: 20px;
+ display: inline;
+}
+
+
+/**** Sidebar ***/
+
+
+#right {
+ width: 315px;
+ float: right;
+ display:block;
+ margin-top: 10px;
+}
+
+#right .box {
+ width: 24em;/*280px*/
+ background: #F6F9FB;
+ border: 1px solid #E1E1E1;
+ padding:10px 10px 15px 10px;
+ float: right;
+}
+
+#right .box h2 {
+ font-size: 1.1em;
+ margin: 0px 0 0px 0;
+ padding:0px 0 5px 0;
+}
+
+#right .box a {
+ margin: 10px 0 10px 0;
+ color: #93B300;
+ font-size: 10px;
+}
+
+#right .box p {
+ margin: 5px 0 10px 0;
+ line-height: 15px;
+}
+
+#right .box ul {
+ padding: 0 0 7px 20px;
+ margin:10px 0 10px 0;
+}
+
+#right .box li {
+ margin-top:5px;
+}
+
+#nav{ list-style: none; margin: 2.0em 0; width: 25em; float: right;}
+#nav li{ padding: 0; margin: 0; }
+#nav a{
+ display: block;
+ height: 2.0em;
+ padding: 0.3em 0.3em 0.3em 0.8em;
+ border-bottom: 2px; /*solid #1a1a1a*/
+ border-top: 2px; /*solid #1a1a1a*/
+ color: #93B300;
+ background-color: #F7F9FB;
+ font-weight: bold;
+ text-decoration: none;
+ }
+
+#nav a:hover{
+ color: #1a1a1a;
+ background: url(../img/bg_t.gif) no-repeat;
+ background-color: #fff;
+ font-weight: bold;
+ }
+
+/**** Clear Div ***/
+
+
+#clear {
+ display: block;
+ clear: both;
+ width: 100%;
+ height:1px;
+ overflow:hidden;
+}
+
+
+/**** Footer ***/
+
+
+#footer {
+ margin: 40px auto 0 auto;
+ text-align: center;
+ border-top: dotted 1px gray;
+ padding: 20px 0 20px 0;
+ width: 70%;
+}
+
+#footer p {
+ margin: 0px;
+ padding: 0;
+ font-size: 0.9em;
+}
View
BIN  webby/content/img/Thumbs.db
Binary file not shown
View
BIN  webby/content/img/bg_menu.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  webby/content/img/bg_t.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  webby/content/img/bullet.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  webby/content/img/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  webby/content/img/logo_.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  webby/content/img/top_bg.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  webby/content/img/top_bg_.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
24 webby/content/installation/index.txt
@@ -0,0 +1,24 @@
+---
+title: Installation
+layout: web
+created_at: 2009-06-24 09:38:29.666689 +01:00
+filter:
+ - erb
+ - textile
+---
+
+h2. Installing Surpass via Rubygems
+
+@sudo gem install surpass@
+
+h2. Installing Surpass from Source
+
+Source code is available from the "Bazaar":http://bazaar-vcs.org repository:
+
+@bzr branch http://ananelson.com/code/surpass@
+
+To install the gem:
+
+@sudo rake gem:install@
+
+from within the surpass directory.
View
7 webby/content/source/ExcelFormulaLexer.txt
@@ -0,0 +1,7 @@
+---
+title: ExcelFormulaLexer.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/ExcelFormulaLexer.rb") %>
View
7 webby/content/source/ExcelFormulaParser.txt
@@ -0,0 +1,7 @@
+---
+title: ExcelFormulaParser.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/ExcelFormulaParser.rb") %>
View
7 webby/content/source/biff_record.txt
@@ -0,0 +1,7 @@
+---
+title: biff_record.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/biff_record.rb") %>
View
7 webby/content/source/bitmap.txt
@@ -0,0 +1,7 @@
+---
+title: bitmap.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/bitmap.rb") %>
View
7 webby/content/source/cell.txt
@@ -0,0 +1,7 @@
+---
+title: cell.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/cell.rb") %>
View
7 webby/content/source/chart.txt
@@ -0,0 +1,7 @@
+---
+title: chart.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/chart.rb") %>
View
7 webby/content/source/column.txt
@@ -0,0 +1,7 @@
+---
+title: column.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/column.rb") %>
View
7 webby/content/source/document.txt
@@ -0,0 +1,7 @@
+---
+title: document.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/document.rb") %>
View
7 webby/content/source/excel_formula.txt
@@ -0,0 +1,7 @@
+---
+title: excel_formula.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/excel_formula.rb") %>
View
7 webby/content/source/excel_magic.txt
@@ -0,0 +1,7 @@
+---
+title: excel_magic.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/excel_magic.rb") %>
View
7 webby/content/source/formatting.txt
@@ -0,0 +1,7 @@
+---
+title: formatting.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/formatting.rb") %>
View
7 webby/content/source/row.txt
@@ -0,0 +1,7 @@
+---
+title: row.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/row.rb") %>
View
7 webby/content/source/style.txt
@@ -0,0 +1,7 @@
+---
+title: style.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/style.rb") %>
View
7 webby/content/source/surpass.txt
@@ -0,0 +1,7 @@
+---
+title: surpass.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/surpass.rb") %>
View
7 webby/content/source/utilities.txt
@@ -0,0 +1,7 @@
+---
+title: utilities.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/utilities.rb") %>
View
7 webby/content/source/workbook.txt
@@ -0,0 +1,7 @@
+---
+title: workbook.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/workbook.rb") %>
View
7 webby/content/source/worksheet.txt
@@ -0,0 +1,7 @@
+---
+title: worksheet.rb
+layout: web
+filter:
+ - erb
+---
+<%= gorg("/Users/ana/work/surpass/lib/worksheet.rb") %>
Please sign in to comment.
Something went wrong with that request. Please try again.