Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add source files to website content.

  • Loading branch information...
commit 97092337afb3ceaa92f66c5f210225d9966e37de 1 parent 05a39f6
Ana Nelson authored

Showing 35 changed files with 530 additions and 180 deletions. Show diff stats Hide diff stats

  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
1  .bzrignore
@@ -2,3 +2,4 @@ spec/output/*
2 2 examples/*.xls
3 3 pkg/
4 4 webby/output
  5 +.DS_Store
2  Rakefile
@@ -29,7 +29,7 @@ PROJ.ignore_file = '.bzrignore'
29 29
30 30 PROJ.spec.opts << '--color'
31 31
32   -PROJ.exclude = %w{.bzr webby surpass-manual-* examples spec tasks stats .DS_Store}
  32 +PROJ.exclude = %w{.bzr webby surpass-manual-* examples spec tasks stats .DS_Store ._*}
33 33
34 34 desc "Run all examples (except the big ones) in examples dir."
35 35 task :examples do
13 lib/ExcelFormula.g
@@ -28,13 +28,12 @@ expr[arg_type]
28 28 (
29 29 (
30 30 EQ { op = [PTGEQ].pack('C') }
31   -
32   -/* | NE { op = [PTGNE].pack('C') }
33   - | GT { op = [PTGGT].pack('C') }
34   - | LT { op = [PTGLT].pack('C') }
35   - | GE { op = [PTGGE].pack('C') }
36   - | LE { op = [PTGLE].pack('C') }*/
37   -
  31 +/* | NE { op = [PTGNE].pack('C') } */
  32 +/* | GT { op = [PTGGT].pack('C') } */
  33 +/* | LT { op = [PTGLT].pack('C') } */
  34 +/* | GE { op = [PTGGE].pack('C') } */
  35 +/* | LE { op = [PTGLE].pack('C') } */
  36 +
38 37 )
39 38 prec0_expr[arg_type] { @rpn += op }
40 39 )*
112 lib/ExcelFormulaLexer.rb
... ... @@ -1,5 +1,5 @@
1   -# ExcelFormulaLexer (lib/ExcelFormula.g)
2   -# Generated by ANTLR 3.1.2-2008-10-21 on 2009-03-30 00:49:44
  1 +# ExcelFormulaLexer (ExcelFormula.g)
  2 +# Generated by ANTLR 3.1.2-2008-10-21 on 2009-06-15 23:03:59
3 3
4 4 class ExcelFormulaLexer
5 5 require 'stringio'
@@ -186,7 +186,7 @@ def match_range(from, to)
186 186
187 187 def match_EQ()
188 188
189   - # 333:5: '='
  189 + # 332:5: '='
190 190 match(?=)
191 191
192 192 end
@@ -195,7 +195,7 @@ def match_LT()
195 195
196 196 @type = :LT
197 197 @type_int = LT
198   - # 334:5: '<'
  198 + # 333:5: '<'
199 199 match(?<)
200 200 end
201 201
@@ -203,7 +203,7 @@ def match_GT()
203 203
204 204 @type = :GT
205 205 @type_int = GT
206   - # 335:5: '>'
  206 + # 334:5: '>'
207 207 match(?>)
208 208 end
209 209
@@ -211,7 +211,7 @@ def match_NE()
211 211
212 212 @type = :NE
213 213 @type_int = NE
214   - # 336:5: '<>'
  214 + # 335:5: '<>'
215 215 match("<>")
216 216
217 217 end
@@ -220,7 +220,7 @@ def match_LE()
220 220
221 221 @type = :LE
222 222 @type_int = LE
223   - # 337:5: '<='
  223 + # 336:5: '<='
224 224 match("<=")
225 225
226 226 end
@@ -229,7 +229,7 @@ def match_GE()
229 229
230 230 @type = :GE
231 231 @type_int = GE
232   - # 338:5: '>='
  232 + # 337:5: '>='
233 233 match(">=")
234 234
235 235 end
@@ -238,7 +238,7 @@ def match_ADD()
238 238
239 239 @type = :ADD
240 240 @type_int = ADD
241   - # 340:6: '+'
  241 + # 339:6: '+'
242 242 match(?+)
243 243 end
244 244
@@ -246,7 +246,7 @@ def match_SUB()
246 246
247 247 @type = :SUB
248 248 @type_int = SUB
249   - # 341:6: '-'
  249 + # 340:6: '-'
250 250 match(?-)
251 251 end
252 252
@@ -254,7 +254,7 @@ def match_MUL()
254 254
255 255 @type = :MUL
256 256 @type_int = MUL
257   - # 342:6: '*'
  257 + # 341:6: '*'
258 258 match(?*)
259 259 end
260 260
@@ -262,7 +262,7 @@ def match_DIV()
262 262
263 263 @type = :DIV
264 264 @type_int = DIV
265   - # 343:6: '/'
  265 + # 342:6: '/'
266 266 match(?/)
267 267 end
268 268
@@ -270,7 +270,7 @@ def match_COLON()
270 270
271 271 @type = :COLON
272 272 @type_int = COLON
273   - # 345:8: ':'
  273 + # 344:8: ':'
274 274 match(?:)
275 275 end
276 276
@@ -278,7 +278,7 @@ def match_SEMICOLON()
278 278
279 279 @type = :SEMICOLON
280 280 @type_int = SEMICOLON
281   - # 346:12: ';'
  281 + # 345:12: ';'
282 282 match(?;)
283 283 end
284 284
@@ -286,7 +286,7 @@ def match_COMMA()
286 286
287 287 @type = :COMMA
288 288 @type_int = COMMA
289   - # 347:8: ','
  289 + # 346:8: ','
290 290 match(?,)
291 291 end
292 292
@@ -294,7 +294,7 @@ def match_LP()
294 294
295 295 @type = :LP
296 296 @type_int = LP
297   - # 349:5: '('
  297 + # 348:5: '('
298 298 match(?()
299 299 end
300 300
@@ -302,7 +302,7 @@ def match_RP()
302 302
303 303 @type = :RP
304 304 @type_int = RP
305   - # 350:5: ')'
  305 + # 349:5: ')'
306 306 match(?))
307 307 end
308 308
@@ -310,7 +310,7 @@ def match_CONCAT()
310 310
311 311 @type = :CONCAT
312 312 @type_int = CONCAT
313   - # 351:9: '&'
  313 + # 350:9: '&'
314 314 match(?&)
315 315 end
316 316
@@ -318,7 +318,7 @@ def match_PERCENT()
318 318
319 319 @type = :PERCENT
320 320 @type_int = PERCENT
321   - # 352:10: '%'
  321 + # 351:10: '%'
322 322 match(?%)
323 323 end
324 324
@@ -326,7 +326,7 @@ def match_POWER()
326 326
327 327 @type = :POWER
328 328 @type_int = POWER
329   - # 353:8: '^'
  329 + # 352:8: '^'
330 330 match(?^)
331 331 end
332 332
@@ -334,7 +334,7 @@ def match_BANG()
334 334
335 335 @type = :BANG
336 336 @type_int = BANG
337   - # 354:7: '!'
  337 + # 353:7: '!'
338 338 match(?!)
339 339 end
340 340
@@ -342,7 +342,7 @@ def match_DIGIT()
342 342
343 343 @type = :DIGIT
344 344 @type_int = DIGIT
345   - # 356:8: '0' .. '9'
  345 + # 355:8: '0' .. '9'
346 346 match_range(?0, ?9)
347 347 end
348 348
@@ -350,8 +350,8 @@ def match_INT_CONST()
350 350
351 351 @type = :INT_CONST
352 352 @type_int = INT_CONST
353   - # 358:12: ( DIGIT )+
354   - # 358:12: ( DIGIT )+
  353 + # 357:12: ( DIGIT )+
  354 + # 357:12: ( DIGIT )+
355 355 matchedOnce1 = false
356 356 while true
357 357 alt1 = 2
@@ -363,7 +363,7 @@ def match_INT_CONST()
363 363 end
364 364 case alt1
365 365 when 1
366   - # 358:12: DIGIT
  366 + # 357:12: DIGIT
367 367 match_DIGIT()
368 368 else
369 369 break
@@ -372,7 +372,7 @@ def match_INT_CONST()
372 372 end
373 373
374 374 if !matchedOnce1
375   - raise "Expected at least one match: 358:12: ( DIGIT )+"
  375 + raise "Expected at least one match: 357:12: ( DIGIT )+"
376 376 end
377 377 end
378 378
@@ -380,8 +380,8 @@ def match_NUM_CONST()
380 380
381 381 @type = :NUM_CONST
382 382 @type_int = NUM_CONST
383   - # 359:12: ( DIGIT )* '.' ( DIGIT )+ ( ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+ )?
384   - # 359:12: ( DIGIT )*
  383 + # 358:12: ( DIGIT )* '.' ( DIGIT )+ ( ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+ )?
  384 + # 358:12: ( DIGIT )*
385 385 while true
386 386 alt2 = 2
387 387 #
@@ -392,14 +392,14 @@ def match_NUM_CONST()
392 392 end
393 393 case alt2
394 394 when 1
395   - # 359:12: DIGIT
  395 + # 358:12: DIGIT
396 396 match_DIGIT()
397 397 else
398 398 break
399 399 end
400 400 end
401 401 match(?.)
402   - # 359:23: ( DIGIT )+
  402 + # 358:23: ( DIGIT )+
403 403 matchedOnce3 = false
404 404 while true
405 405 alt3 = 2
@@ -411,7 +411,7 @@ def match_NUM_CONST()
411 411 end
412 412 case alt3
413 413 when 1
414   - # 359:23: DIGIT
  414 + # 358:23: DIGIT
415 415 match_DIGIT()
416 416 else
417 417 break
@@ -420,9 +420,9 @@ def match_NUM_CONST()
420 420 end
421 421
422 422 if !matchedOnce3
423   - raise "Expected at least one match: 359:23: ( DIGIT )+"
  423 + raise "Expected at least one match: 358:23: ( DIGIT )+"
424 424 end
425   - # 359:30: ( ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+ )?
  425 + # 358:30: ( ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+ )?
426 426 alt6 = 2
427 427 #
428 428 look_ahead6_0 = @input.look_ahead(1)
@@ -433,13 +433,13 @@ def match_NUM_CONST()
433 433 end
434 434 case alt6
435 435 when 1
436   - # 359:31: ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+
  436 + # 358:31: ( 'E' | 'e' ) ( '+' | '-' )? ( DIGIT )+
437 437 if @input.look_ahead(1) == ?E || @input.look_ahead(1) == ?e
438 438 match()
439 439 else
440 440 raise "Expected set"
441 441 end
442   - # 359:41: ( '+' | '-' )?
  442 + # 358:41: ( '+' | '-' )?
443 443 alt4 = 2
444 444 #
445 445 look_ahead4_0 = @input.look_ahead(1)
@@ -457,7 +457,7 @@ def match_NUM_CONST()
457 457 raise "Expected set"
458 458 end
459 459 end
460   - # 359:52: ( DIGIT )+
  460 + # 358:52: ( DIGIT )+
461 461 matchedOnce5 = false
462 462 while true
463 463 alt5 = 2
@@ -469,7 +469,7 @@ def match_NUM_CONST()
469 469 end
470 470 case alt5
471 471 when 1
472   - # 359:52: DIGIT
  472 + # 358:52: DIGIT
473 473 match_DIGIT()
474 474 else
475 475 break
@@ -478,7 +478,7 @@ def match_NUM_CONST()
478 478 end
479 479
480 480 if !matchedOnce5
481   - raise "Expected at least one match: 359:52: ( DIGIT )+"
  481 + raise "Expected at least one match: 358:52: ( DIGIT )+"
482 482 end
483 483 end
484 484 end
@@ -487,7 +487,7 @@ def match_STR_CONST()
487 487
488 488 @type = :STR_CONST
489 489 @type_int = STR_CONST
490   - # 360:12: '\"' ~ '\"' '\"'
  490 + # 359:12: '\"' ~ '\"' '\"'
491 491 match(?")
492 492 if (@input.look_ahead(1) >= 0x0000 && @input.look_ahead(1) <= ?!) || (@input.look_ahead(1) >= ?# && @input.look_ahead(1) <= 0x00FF)
493 493 match()
@@ -501,8 +501,8 @@ def match_REF2D()
501 501
502 502 @type = :REF2D
503 503 @type_int = REF2D
504   - # 361:8: ( '$' )? ( 'A' .. 'I' )? ( 'A' .. 'Z' ) ( '$' )? ( DIGIT )+
505   - # 361:8: ( '$' )?
  504 + # 360:8: ( '$' )? ( 'A' .. 'I' )? ( 'A' .. 'Z' ) ( '$' )? ( DIGIT )+
  505 + # 360:8: ( '$' )?
506 506 alt7 = 2
507 507 #
508 508 look_ahead7_0 = @input.look_ahead(1)
@@ -513,10 +513,10 @@ def match_REF2D()
513 513 end
514 514 case alt7
515 515 when 1
516   - # 361:8: '$'
  516 + # 360:8: '$'
517 517 match(?$)
518 518 end
519   - # 361:13: ( 'A' .. 'I' )?
  519 + # 360:13: ( 'A' .. 'I' )?
520 520 alt8 = 2
521 521 #
522 522 look_ahead8_0 = @input.look_ahead(1)
@@ -533,12 +533,12 @@ def match_REF2D()
533 533 end
534 534 case alt8
535 535 when 1
536   - # 361:14: 'A' .. 'I'
  536 + # 360:14: 'A' .. 'I'
537 537 match_range(?A, ?I)
538 538 end
539   - # 361:26: 'A' .. 'Z'
  539 + # 360:26: 'A' .. 'Z'
540 540 match_range(?A, ?Z)
541   - # 361:36: ( '$' )?
  541 + # 360:36: ( '$' )?
542 542 alt9 = 2
543 543 #
544 544 look_ahead9_0 = @input.look_ahead(1)
@@ -549,10 +549,10 @@ def match_REF2D()
549 549 end
550 550 case alt9
551 551 when 1
552   - # 361:36: '$'
  552 + # 360:36: '$'
553 553 match(?$)
554 554 end
555   - # 361:41: ( DIGIT )+
  555 + # 360:41: ( DIGIT )+
556 556 matchedOnce10 = false
557 557 while true
558 558 alt10 = 2
@@ -564,7 +564,7 @@ def match_REF2D()
564 564 end
565 565 case alt10
566 566 when 1
567   - # 361:41: DIGIT
  567 + # 360:41: DIGIT
568 568 match_DIGIT()
569 569 else
570 570 break
@@ -573,7 +573,7 @@ def match_REF2D()
573 573 end
574 574
575 575 if !matchedOnce10
576   - raise "Expected at least one match: 361:41: ( DIGIT )+"
  576 + raise "Expected at least one match: 360:41: ( DIGIT )+"
577 577 end
578 578 end
579 579
@@ -581,7 +581,7 @@ def match_TRUE_CONST()
581 581
582 582 @type = :TRUE_CONST
583 583 @type_int = TRUE_CONST
584   - # 362:13: ( 'T' | 't' ) ( 'R' | 'r' ) ( 'U' | 'u' ) ( 'E' | 'e' )
  584 + # 361:13: ( 'T' | 't' ) ( 'R' | 'r' ) ( 'U' | 'u' ) ( 'E' | 'e' )
585 585 if @input.look_ahead(1) == ?T || @input.look_ahead(1) == ?t
586 586 match()
587 587 else
@@ -608,7 +608,7 @@ def match_FALSE_CONST()
608 608
609 609 @type = :FALSE_CONST
610 610 @type_int = FALSE_CONST
611   - # 363:14: ( 'F' | 'f' ) ( 'A' | 'a' ) ( 'L' | 'l' ) ( 'S' | 's' ) ( 'E' | 'e' )
  611 + # 362:14: ( 'F' | 'f' ) ( 'A' | 'a' ) ( 'L' | 'l' ) ( 'S' | 's' ) ( 'E' | 'e' )
612 612 if @input.look_ahead(1) == ?F || @input.look_ahead(1) == ?f
613 613 match()
614 614 else
@@ -640,7 +640,7 @@ def match_NAME()
640 640
641 641 @type = :NAME
642 642 @type_int = NAME
643   - # 364:7: '\\w[\\.\\w]*'
  643 + # 363:7: '\\w[\\.\\w]*'
644 644 match("w[.w]*")
645 645
646 646 end
@@ -649,7 +649,7 @@ def match_QUOTENAME()
649 649
650 650 @type = :QUOTENAME
651 651 @type_int = QUOTENAME
652   - # 365:12: '\\'(?:[^\\']|\\'\\')*\\''
  652 + # 364:12: '\\'(?:[^\\']|\\'\\')*\\''
653 653 match("'(?:[^']|'')*'")
654 654
655 655 end
@@ -658,7 +658,7 @@ def match_FUNC_IF()
658 658
659 659 @type = :FUNC_IF
660 660 @type_int = FUNC_IF
661   - # 366:10: 'IF'
  661 + # 365:10: 'IF'
662 662 match("IF")
663 663
664 664 end
@@ -667,7 +667,7 @@ def match_FUNC_CHOOSE()
667 667
668 668 @type = :FUNC_CHOOSE
669 669 @type_int = FUNC_CHOOSE
670   - # 367:14: 'CHOOSE'
  670 + # 366:14: 'CHOOSE'
671 671 match("CHOOSE")
672 672
673 673 end
86 lib/ExcelFormulaParser.rb
... ... @@ -1,5 +1,5 @@
1   -# ExcelFormulaParser (lib/ExcelFormula.g)
2   -# Generated by ANTLR 3.1.2-2008-10-21 on 2009-03-30 00:49:44
  1 +# ExcelFormulaParser (ExcelFormula.g)
  2 +# Generated by ANTLR 3.1.2-2008-10-21 on 2009-06-15 23:03:59
3 3
4 4 require 'ExcelFormulaLexer' unless defined?(ExcelFormulaLexer)
5 5
@@ -117,15 +117,15 @@ def expr(arg_type)
117 117
118 118 end
119 119
120   - # 43:1: prec0_expr[arg_type] : prec1_expr[arg_type] ( ( CONCAT ) prec1_expr[arg_type] )* ;
  120 + # 42:1: prec0_expr[arg_type] : prec1_expr[arg_type] ( ( CONCAT ) prec1_expr[arg_type] )* ;
121 121 def prec0_expr(arg_type)
122 122
123 123
124 124
125   - # 44:7: prec1_expr[arg_type] ( ( CONCAT ) prec1_expr[arg_type] )*
  125 + # 43:7: prec1_expr[arg_type] ( ( CONCAT ) prec1_expr[arg_type] )*
126 126 prec1_expr(arg_type)
127 127
128   - # 45:9: ( ( CONCAT ) prec1_expr[arg_type] )*
  128 + # 44:9: ( ( CONCAT ) prec1_expr[arg_type] )*
129 129 while true
130 130 alt2 = 2
131 131 #
@@ -135,8 +135,8 @@ def prec0_expr(arg_type)
135 135 end
136 136 case alt2
137 137 when 1
138   - # 46:13: ( CONCAT ) prec1_expr[arg_type]
139   - # 47:17: CONCAT
  138 + # 45:13: ( CONCAT ) prec1_expr[arg_type]
  139 + # 46:17: CONCAT
140 140 match(:CONCAT)
141 141 op = [PTGCONCAT].pack('C')
142 142 prec1_expr(arg_type)
@@ -151,15 +151,15 @@ def prec0_expr(arg_type)
151 151
152 152 end
153 153
154   - # 53:1: prec1_expr[arg_type] : prec2_expr[arg_type] ( ( ADD | SUB ) prec2_expr[arg_type] )* ;
  154 + # 52:1: prec1_expr[arg_type] : prec2_expr[arg_type] ( ( ADD | SUB ) prec2_expr[arg_type] )* ;
155 155 def prec1_expr(arg_type)
156 156
157 157
158 158
159   - # 54:7: prec2_expr[arg_type] ( ( ADD | SUB ) prec2_expr[arg_type] )*
  159 + # 53:7: prec2_expr[arg_type] ( ( ADD | SUB ) prec2_expr[arg_type] )*
160 160 prec2_expr(arg_type)
161 161
162   - # 55:9: ( ( ADD | SUB ) prec2_expr[arg_type] )*
  162 + # 54:9: ( ( ADD | SUB ) prec2_expr[arg_type] )*
163 163 while true
164 164 alt4 = 2
165 165 #
@@ -169,8 +169,8 @@ def prec1_expr(arg_type)
169 169 end
170 170 case alt4
171 171 when 1
172   - # 56:13: ( ADD | SUB ) prec2_expr[arg_type]
173   - # 56:13: ( ADD | SUB )
  172 + # 55:13: ( ADD | SUB ) prec2_expr[arg_type]
  173 + # 55:13: ( ADD | SUB )
174 174 alt3 = 2
175 175 #
176 176 look_ahead3_0 = look_ahead(1)
@@ -183,11 +183,11 @@ def prec1_expr(arg_type)
183 183 end
184 184 case alt3
185 185 when 1
186   - # 57:19: ADD
  186 + # 56:19: ADD
187 187 match(:ADD)
188 188 op = [PTGADD].pack('C')
189 189 when 2
190   - # 58:19: SUB
  190 + # 57:19: SUB
191 191 match(:SUB)
192 192 op = [PTGSUB].pack('C')
193 193 end
@@ -203,15 +203,15 @@ def prec1_expr(arg_type)
203 203
204 204 end
205 205
206   - # 65:1: prec2_expr[arg_type] : prec3_expr[arg_type] ( ( MUL | DIV ) prec3_expr[arg_type] )* ;
  206 + # 64:1: prec2_expr[arg_type] : prec3_expr[arg_type] ( ( MUL | DIV ) prec3_expr[arg_type] )* ;
207 207 def prec2_expr(arg_type)
208 208
209 209
210 210
211   - # 66:7: prec3_expr[arg_type] ( ( MUL | DIV ) prec3_expr[arg_type] )*
  211 + # 65:7: prec3_expr[arg_type] ( ( MUL | DIV ) prec3_expr[arg_type] )*
212 212 prec3_expr(arg_type)
213 213
214   - # 67:9: ( ( MUL | DIV ) prec3_expr[arg_type] )*
  214 + # 66:9: ( ( MUL | DIV ) prec3_expr[arg_type] )*
215 215 while true
216 216 alt6 = 2
217 217 #
@@ -221,8 +221,8 @@ def prec2_expr(arg_type)
221 221 end
222 222 case alt6
223 223 when 1
224   - # 68:13: ( MUL | DIV ) prec3_expr[arg_type]
225   - # 68:13: ( MUL | DIV )
  224 + # 67:13: ( MUL | DIV ) prec3_expr[arg_type]
  225 + # 67:13: ( MUL | DIV )
226 226 alt5 = 2
227 227 #
228 228 look_ahead5_0 = look_ahead(1)
@@ -235,11 +235,11 @@ def prec2_expr(arg_type)
235 235 end
236 236 case alt5
237 237 when 1
238   - # 69:19: MUL
  238 + # 68:19: MUL
239 239 match(:MUL)
240 240 op = [PTGMUL].pack('C')
241 241 when 2
242   - # 70:19: DIV
  242 + # 69:19: DIV
243 243 match(:DIV)
244 244 op = [PTGDIV].pack('C')
245 245 end
@@ -255,15 +255,15 @@ def prec2_expr(arg_type)
255 255
256 256 end
257 257
258   - # 76:1: prec3_expr[arg_type] : prec5_expr[arg_type] ( ( POWER ) prec5_expr[arg_type] )* ;
  258 + # 75:1: prec3_expr[arg_type] : prec5_expr[arg_type] ( ( POWER ) prec5_expr[arg_type] )* ;
259 259 def prec3_expr(arg_type)
260 260
261 261
262 262
263   - # 77:7: prec5_expr[arg_type] ( ( POWER ) prec5_expr[arg_type] )*
  263 + # 76:7: prec5_expr[arg_type] ( ( POWER ) prec5_expr[arg_type] )*
264 264 prec5_expr(arg_type)
265 265
266   - # 78:9: ( ( POWER ) prec5_expr[arg_type] )*
  266 + # 77:9: ( ( POWER ) prec5_expr[arg_type] )*
267 267 while true
268 268 alt7 = 2
269 269 #
@@ -273,8 +273,8 @@ def prec3_expr(arg_type)
273 273 end
274 274 case alt7
275 275 when 1
276   - # 79:13: ( POWER ) prec5_expr[arg_type]
277   - # 80:17: POWER
  276 + # 78:13: ( POWER ) prec5_expr[arg_type]
  277 + # 79:17: POWER
278 278 match(:POWER)
279 279 op = [PTGPOWER].pack('C')
280 280 prec5_expr(arg_type)
@@ -289,15 +289,15 @@ def prec3_expr(arg_type)
289 289
290 290 end
291 291
292   - # 86:1: prec4_expr[arg_type] : prec5_expr[arg_type] ( PERCENT )? ;
  292 + # 85:1: prec4_expr[arg_type] : prec5_expr[arg_type] ( PERCENT )? ;
293 293 def prec4_expr(arg_type)
294 294
295 295
296 296
297   - # 87:7: prec5_expr[arg_type] ( PERCENT )?
  297 + # 86:7: prec5_expr[arg_type] ( PERCENT )?
298 298 prec5_expr(arg_type)
299 299
300   - # 88:9: ( PERCENT )?
  300 + # 87:9: ( PERCENT )?
301 301 alt8 = 2
302 302 #
303 303 look_ahead8_0 = look_ahead(1)
@@ -307,7 +307,7 @@ def prec4_expr(arg_type)
307 307 end
308 308 case alt8
309 309 when 1
310   - # 89:13: PERCENT
  310 + # 88:13: PERCENT
311 311 match(:PERCENT)
312 312 @rpn += [PTGPERCENT].pack('C')
313 313 end
@@ -316,12 +316,12 @@ def prec4_expr(arg_type)
316 316
317 317 end
318 318
319   - # 93:1: prec5_expr[arg_type] : ( primary[arg_type] | SUB primary[arg_type] );
  319 + # 92:1: prec5_expr[arg_type] : ( primary[arg_type] | SUB primary[arg_type] );
320 320 def prec5_expr(arg_type)
321 321
322 322
323 323
324   - # 94:5: ( primary[arg_type] | SUB primary[arg_type] )
  324 + # 93:5: ( primary[arg_type] | SUB primary[arg_type] )
325 325 alt9 = 2
326 326 #
327 327 look_ahead9_0 = look_ahead(1)
@@ -334,11 +334,11 @@ def prec5_expr(arg_type)
334 334 end
335 335 case alt9
336 336 when 1
337   - # 94:7: primary[arg_type]
  337 + # 93:7: primary[arg_type]
338 338 primary(arg_type)
339 339
340 340 when 2
341   - # 95:7: SUB primary[arg_type]
  341 + # 94:7: SUB primary[arg_type]
342 342 match(:SUB)
343 343 primary(arg_type)
344 344
@@ -349,7 +349,7 @@ def prec5_expr(arg_type)
349 349
350 350 end
351 351
352   - # 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 );
  352 + # 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 );
353 353 def primary(arg_type)
354 354 _str_tok = nil
355 355 _int_tok = nil
@@ -361,31 +361,31 @@ def primary(arg_type)
361 361
362 362
363 363
364   - # 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 )
  364 + # 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 )
365 365 alt10 = 7
366 366 alt10 = DFA10.predict(self, @input)
367 367 case alt10
368 368 when 1
369   - # 99:7: TRUE_CONST
  369 + # 98:7: TRUE_CONST
370 370 match(:TRUE_CONST)
371 371
372 372 @rpn += [PTGBOOL, 1].pack("C2")
373 373
374 374 when 2
375   - # 103:7: FALSE_CONST
  375 + # 102:7: FALSE_CONST
376 376 match(:FALSE_CONST)
377 377
378 378 @rpn += [PTGBOOL, 0].pack("C2")
379 379
380 380 when 3
381   - # 107:7: str_tok= STR_CONST
  381 + # 106:7: str_tok= STR_CONST
382 382 _str_tok = @input.look_ahead(1)
383 383 match(:STR_CONST)
384 384
385 385 @rpn += [PTGSTR].pack('C') + upack1(str_tok.text[1, -1]) #TODO
386 386
387 387 when 4
388   - # 111:7: int_tok= INT_CONST
  388 + # 110:7: int_tok= INT_CONST
389 389 _int_tok = @input.look_ahead(1)
390 390 match(:INT_CONST)
391 391
@@ -397,14 +397,14 @@ def primary(arg_type)
397 397 end
398 398
399 399 when 5
400   - # 120:7: num_tok= NUM_CONST
  400 + # 119:7: num_tok= NUM_CONST
401 401 _num_tok = @input.look_ahead(1)
402 402 match(:NUM_CONST)
403 403
404 404 @rpn += [ptgNum, num_tok.text.to_f].pack("CE")
405 405
406 406 when 6
407   - # 124:7: ref2d_tok= REF2D
  407 + # 123:7: ref2d_tok= REF2D
408 408 _ref2d_tok = @input.look_ahead(1)
409 409 match(:REF2D)
410 410
@@ -413,7 +413,7 @@ def primary(arg_type)
413 413 @rpn += [ptg, r, c].pack("Cv2")
414 414
415 415 when 7
416   - # 130:7: ref2d1_tok= REF2D COLON ref2d2_tok= REF2D
  416 + # 129:7: ref2d1_tok= REF2D COLON ref2d2_tok= REF2D
417 417 _ref2d1_tok = @input.look_ahead(1)
418 418 match(:REF2D)
419 419 match(:COLON)
72 lib/ExcelFormula__.g
... ... @@ -1,72 +0,0 @@
1   -lexer grammar ExcelFormula;
2   -options {
3   - language=Ruby;
4   -
5   -}
6   -
7   -// $ANTLR src "lib/ExcelFormula.g" 332
8   -fragment
9   -EQ: '=';
10   -// $ANTLR src "lib/ExcelFormula.g" 334
11   -LT: '<';
12   -// $ANTLR src "lib/ExcelFormula.g" 335
13   -GT: '>';
14   -// $ANTLR src "lib/ExcelFormula.g" 336
15   -NE: '<>';
16   -// $ANTLR src "lib/ExcelFormula.g" 337
17   -LE: '<=';
18   -// $ANTLR src "lib/ExcelFormula.g" 338
19   -GE: '>=';
20   -
21   -// $ANTLR src "lib/ExcelFormula.g" 340
22   -ADD: '+';
23   -// $ANTLR src "lib/ExcelFormula.g" 341
24   -SUB: '-';
25   -// $ANTLR src "lib/ExcelFormula.g" 342
26   -MUL: '*';
27   -// $ANTLR src "lib/ExcelFormula.g" 343
28   -DIV: '/';
29   -
30   -// $ANTLR src "lib/ExcelFormula.g" 345
31   -COLON: ':';
32   -// $ANTLR src "lib/ExcelFormula.g" 346
33   -SEMICOLON: ';';
34   -// $ANTLR src "lib/ExcelFormula.g" 347
35   -COMMA: ',';
36   -
37   -// $ANTLR src "lib/ExcelFormula.g" 349
38   -LP: '(';
39   -// $ANTLR src "lib/ExcelFormula.g" 350
40   -RP: ')';
41   -// $ANTLR src "lib/ExcelFormula.g" 351
42   -CONCAT: '&';
43   -// $ANTLR src "lib/ExcelFormula.g" 352
44   -PERCENT: '%';
45   -// $ANTLR src "lib/ExcelFormula.g" 353
46   -POWER: '^';
47   -// $ANTLR src "lib/ExcelFormula.g" 354
48   -BANG: '!';
49   -
50   -// $ANTLR src "lib/ExcelFormula.g" 356
51   -DIGIT: '0'..'9';
52   -
53   -// $ANTLR src "lib/ExcelFormula.g" 358
54   -INT_CONST: DIGIT+ ;
55   -// $ANTLR src "lib/ExcelFormula.g" 359
56   -NUM_CONST: DIGIT* '.' DIGIT+ (('E'|'e') ('+'|'-')? DIGIT+)?; // \d*\.\d+(?:[Ee][+-]?\d+)?
57   -// $ANTLR src "lib/ExcelFormula.g" 360
58   -STR_CONST: '"' ~'"' '"'; // TODO add escape recognition
59   -// $ANTLR src "lib/ExcelFormula.g" 361
60   -REF2D: '$'? ('A'..'I')? ('A'..'Z') '$'? DIGIT+;
61   -// $ANTLR src "lib/ExcelFormula.g" 362
62   -TRUE_CONST: ('T'|'t') ('R'|'r') ('U'|'u') ('E'|'e') ;
63   -// $ANTLR src "lib/ExcelFormula.g" 363
64   -FALSE_CONST: ('F'|'f') ('A'|'a') ('L'|'l') ('S'|'s') ('E'|'e') ;
65   -// $ANTLR src "lib/ExcelFormula.g" 364
66   -NAME: '\w[\.\w]*' ;
67   -// $ANTLR src "lib/ExcelFormula.g" 365
68   -QUOTENAME: '\'(?:[^\']|\'\')*\'';
69   -// $ANTLR src "lib/ExcelFormula.g" 366
70   -FUNC_IF: 'IF';
71   -// $ANTLR src "lib/ExcelFormula.g" 367
72   -FUNC_CHOOSE: 'CHOOSE';
2  spec/excel_formula_spec.rb
@@ -20,7 +20,7 @@
20 20 it "should parse a product" do
21 21 ExcelFormula.new("TRUE*TRUE").to_biff
22 22 end
23   -
  23 +
24 24 it "should raise an error if invalid formula is passed" do
25 25 lambda { ExcelFormula.new("RUBBISHXYZ") }.should raise_error
26 26 end
BIN  surpass-manual-0-0-5.pdf
Binary file not shown
279 webby/content/css/style.css
... ... @@ -0,0 +1,279 @@
  1 +/* ======================================================== */
  2 +/* Created by Devit Schizoper */
  3 +/* Created HomePages http://LoadFoo.starzonewebhost.com */
  4 +/* Created Day 01.12.2006 */
  5 +/* ======================================================== */
  6 +
  7 +
  8 +body {
  9 + margin: 0px;
  10 + background: url(../img/top_bg.gif);
  11 + background-repeat: repeat-x;
  12 + font-family: Verdana, Arial, sans-serif;
  13 + font-size: .6em;
  14 +}
  15 +
  16 +p {
  17 + line-height: 17px;
  18 + margin: 11px 0 10px 0;
  19 + padding: 0px;
  20 + font-size: 1.2em;
  21 +}
  22 +
  23 +code {
  24 + font-size: 1.3em;
  25 +}
  26 +.code {
  27 + font-size: 1.3em;
  28 +}
  29 +
  30 +.highlight {
  31 + font-size: 1.5em;
  32 +}
  33 +
  34 +h2 {
  35 + color: #9f9f9f;
  36 + margin:0px;
  37 + padding:0px;
  38 + font-size: 15px;
  39 +}
  40 +
  41 +ul {
  42 + font-size: 10px;
  43 + margin:0;
  44 + padding:0;
  45 + list-style-image: url(../img/bullet.gif);
  46 +}
  47 +
  48 +a {
  49 + color: #93B300;
  50 +}
  51 +
  52 +a:hover {
  53 + text-decoration: none;
  54 +}
  55 +
  56 +blockquote{
  57 + background: #F7FDE3;
  58 + color: #606060;
  59 + padding: 10px;
  60 +}
  61 +
  62 +
  63 +/**** Main Container ***/
  64 +
  65 +
  66 +#wrap {
  67 + margin-left: auto;
  68 + margin-right: auto;
  69 + width: 730px;
  70 +}
  71 +
  72 +
  73 +/**** Top ***/
  74 +
  75 +
  76 +#top {
  77 + width: 100%;
  78 + height: 88px;
  79 + color: #fff;
  80 + background: #000 url(../img/top_bg.gif);
  81 + overflow:hidden;
  82 +}
  83 +
  84 +#top h2 {
  85 + color: White;
  86 + letter-spacing: 3px;
  87 + font-size: 2.4em;
  88 + font-weight: normal;
  89 + position: relative;
  90 + margin: 0px;
  91 + top:33px;
  92 + display:block;
  93 + float:left;
  94 + background: url(../img/bg_t.gif) no-repeat;
  95 + padding-left: 10px;
  96 +}
  97 +
  98 +#top h2 a {
  99 + color: white;
  100 + text-decoration: none;
  101 +}
  102 +
  103 +#top h2 a:hover {
  104 + color: #93B300;
  105 +}
  106 +
  107 +
  108 +/**** Main Menu ***/
  109 +
  110 +
  111 +#menu {
  112 + display: block;
  113 + float:right;
  114 +}
  115 +
  116 +#menu ul {
  117 + margin: 0;
  118 + list-style: none;
  119 +}
  120 +
  121 +#menu li {
  122 + display: block;
  123 + float: left;
  124 + white-space: nowrap;
  125 +}
  126 +
  127 +#menu li a {
  128 + display: block;
  129 + padding: 55px 20px 12px 20px;
  130 + text-decoration: none;
  131 + color: #fff;
  132 + font-weight: bold;
  133 +}
  134 +
  135 +* html #menu a {width:1%;}
  136 +
  137 +#menu li a:hover {
  138 + background: url(../img/bg_menu.gif);
  139 +}
  140 +
  141 +#menu li a.current {
  142 + letter-spacing: 1px;
  143 + color: gray;
  144 + background: url(../img/bg_menu.gif);
  145 +}
  146 +
  147 +#menu li a.current:hover {
  148 + color: #fff;
  149 +}
  150 +
  151 +
  152 +/**** Content Container ***/
  153 +
  154 +
  155 +#content {
  156 + width: 100%;
  157 + margin-top:30px;
  158 +}
  159 +
  160 +#content h2 {
  161 + margin: 0;
  162 + padding: 10px 0 10px 0;
  163 +}
  164 +
  165 +
  166 +/**** Content ***/
  167 +
  168 +
  169 +#left ul {
  170 + padding: 15px 0 15px 35px;
  171 + margin:0;
  172 +}
  173 +
  174 +#left li {
  175 + margin-bottom:5px;
  176 +}
  177 +
  178 +#left {
  179 + width: 390px;
  180 + float:left;
  181 + display: block;
  182 + margin-left: 20px;
  183 + display: inline;
  184 +}
  185 +
  186 +
  187 +/**** Sidebar ***/
  188 +
  189 +
  190 +#right {
  191 + width: 315px;
  192 + float: right;
  193 + display:block;
  194 + margin-top: 10px;
  195 +}
  196 +
  197 +#right .box {
  198 + width: 24em;/*280px*/
  199 + background: #F6F9FB;
  200 + border: 1px solid #E1E1E1;
  201 + padding:10px 10px 15px 10px;
  202 + float: right;
  203 +}
  204 +
  205 +#right .box h2 {
  206 + font-size: 1.1em;
  207 + margin: 0px 0 0px 0;
  208 + padding:0px 0 5px 0;
  209 +}
  210 +
  211 +#right .box a {
  212 + margin: 10px 0 10px 0;
  213 + color: #93B300;
  214 + font-size: 10px;
  215 +}
  216 +
  217 +#right .box p {
  218 + margin: 5px 0 10px 0;
  219 + line-height: 15px;
  220 +}
  221 +
  222 +#right .box ul {
  223 + padding: 0 0 7px 20px;
  224 + margin:10px 0 10px 0;
  225 +}
  226 +
  227 +#right .box li {
  228 + margin-top:5px;
  229 +}
  230 +
  231 +#nav{ list-style: none; margin: 2.0em 0; width: 25em; float: right;}
  232 +#nav li{ padding: 0; margin: 0; }
  233 +#nav a{
  234 + display: block;
  235 + height: 2.0em;
  236 + padding: 0.3em 0.3em 0.3em 0.8em;
  237 + border-bottom: 2px; /*solid #1a1a1a*/
  238 + border-top: 2px; /*solid #1a1a1a*/
  239 + color: #93B300;
  240 + background-color: #F7F9FB;
  241 + font-weight: bold;
  242 + text-decoration: none;
  243 + }
  244 +
  245 +#nav a:hover{
  246 + color: #1a1a1a;
  247 + background: url(../img/bg_t.gif) no-repeat;
  248 + background-color: #fff;
  249 + font-weight: bold;
  250 + }
  251 +
  252 +/**** Clear Div ***/
  253 +
  254 +
  255 +#clear {
  256 + display: block;
  257 + clear: both;
  258 + width: 100%;
  259 + height:1px;
  260 + overflow:hidden;
  261 +}
  262 +
  263 +
  264 +/**** Footer ***/
  265 +
  266 +
  267 +#footer {
  268 + margin: 40px auto 0 auto;
  269 + text-align: center;
  270 + border-top: dotted 1px gray;
  271 + padding: 20px 0 20px 0;
  272 + width: 70%;
  273 +}
  274 +
  275 +#footer p {
  276 + margin: 0px;
  277 + padding: 0;
  278 + font-size: 0.9em;
  279 +}
BIN  webby/content/img/Thumbs.db
Binary file not shown
BIN  webby/content/img/bg_menu.gif
BIN  webby/content/img/bg_t.gif
BIN  webby/content/img/bullet.gif
BIN  webby/content/img/logo.png
BIN  webby/content/img/logo_.jpg
BIN  webby/content/img/top_bg.gif
BIN  webby/content/img/top_bg_.gif
24 webby/content/installation/index.txt
... ... @@ -0,0 +1,24 @@
  1 +---
  2 +title: Installation
  3 +layout: web
  4 +created_at: 2009-06-24 09:38:29.666689 +01:00
  5 +filter:
  6 + - erb
  7 + - textile
  8 +---
  9 +
  10 +h2. Installing Surpass via Rubygems
  11 +
  12 +@sudo gem install surpass@
  13 +
  14 +h2. Installing Surpass from Source
  15 +
  16 +Source code is available from the "Bazaar":http://bazaar-vcs.org repository:
  17 +
  18 +@bzr branch http://ananelson.com/code/surpass@
  19 +
  20 +To install the gem:
  21 +
  22 +@sudo rake gem:install@
  23 +