cds.simbad
Class SesameFile

java.lang.Object
  extended bycds.simbad.SesameFile

public class SesameFile
extends java.lang.Object

Manages a sesame file. Such a file contains a list of regular expressions and also test examples in a specific format.ot attributable

Version:
1.0 Apr 2003
Author:
Marc Wenger/CDS

Constructor Summary
SesameFile()
           
 
Method Summary
static int checkExamples(java.io.InputStream in, java.lang.String options, Sesame ses)
          Checks all the examples contained in the sesame file
private static void errorMsg(java.lang.String text, java.lang.String command, int num)
          Display an error message
private static int esc_search(java.lang.String str, int offset, char c)
          Find the first non escaped character in a string from the offset on
static void main(java.lang.String[] args)
          Test programme.
static Sesame sesameCreate(java.io.InputStream in)
          Creates a sesame object from a file containing sesame commands
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SesameFile

public SesameFile()
Method Detail

sesameCreate

public static Sesame sesameCreate(java.io.InputStream in)
Creates a sesame object from a file containing sesame commands

Parameters:
in - InputStream
Returns:
a sesame object

checkExamples

public static int checkExamples(java.io.InputStream in,
                                java.lang.String options,
                                Sesame ses)
Checks all the examples contained in the sesame file

Parameters:
in - InputStream to read. The examples are contained in comment lines having the syntax
#+>ident to transform>final ident

esc_search

private static int esc_search(java.lang.String str,
                              int offset,
                              char c)
Find the first non escaped character in a string from the offset on

Parameters:
str - string to analyze
offset - 1st byte to check
c - character to look for
Returns:
position ofthe found character or -1 if not found

errorMsg

private static void errorMsg(java.lang.String text,
                             java.lang.String command,
                             int num)
Display an error message

Parameters:
text - error message
command - command line having produced the error
num - corresponding line number in the file

main

public static void main(java.lang.String[] args)
Test programme.

It reads all the sesame commands in a given file, build a Sesame object ans tests all examples contained in the file Usage: SesameFile filename