next up previous contents
Next: Delimiting arguments Up: The XSPEC Parser Previous: The XSPEC Parser

Basics

The parser routines provide a general, easy interface between a program and the user, particularly for command-driven or other highly interactive programs. The basic cycle begins with the user inputing a line (optionally after some prompt) on the terminal. This line then can be analyzed by the program as a string of arguments. The program then can try to interpret each argument as a number or as a character string. Character strings can be checked if they are one of an allowed list of options. The actual details of how a line is interpreted depend on the particular program and how it uses the various parser facilities. An example of an input line might be:

Foo , 4.7 "Some information" - ! A comment

which is divided into three arguments: `Foo', `4.7' (which can be interpreted as a number), and ``Some information."

When parsing an input line, there are several special characters:

 
   	 blank         		 ( )  		(a horizontal tab is also a blank)

comma (,)

special delim. ( tex2html_wrap_inline13047 ) (the vertical bar)

comment char. (!)

begin quote (") (Note, the begin and end quote are the

end quote (") same character by default, the ")

There are special characters whose interpretation depends on their position in the line:

 
     	 infinite skip 		 (/)

continuation (-)

end of file (/*) or CTRL-Z under VMS



Keith Arnaud (kaa@genji.gsfc.nasa.gov)
Wed May 28 10:59:33 EDT 1997