Polaris: LexString Class Reference

LexString Class Reference

#include <LexString.h>

List of all members.

Public Member Functions

 LexString (char *s)
 Initialize the LexString.
char operator * () const
 Return current character.
int peek () const
 Return next character (0 if none).
void upper ()
 Return next character (0 if none).
void operator++ ()
 Increment index.
 operator const void * () const
 Return non-NULL if characters still left and no error.
int operator! () const
 Opposite of operator const void*.
Boolean try_replace (const char *token)
 Try to match this at the current character with the construct The token must start with a '.'.

Public Attributes

int index
char * buf
int len
Boolean err


Constructor & Destructor Documentation

LexString::LexString char *  s  )  [inline]
 

Initialize the LexString.

Definition at line 39 of file LexString.h.

References buf, err, False, index, and len.


Member Function Documentation

char LexString::operator *  )  const [inline]
 

Return current character.

Definition at line 48 of file LexString.h.

References buf, and index.

int LexString::peek  )  const [inline]
 

Return next character (0 if none).

Definition at line 54 of file LexString.h.

References buf, and index.

void LexString::upper  )  [inline]
 

Return next character (0 if none).

Definition at line 60 of file LexString.h.

References buf, and index.

void LexString::operator++  )  [inline]
 

Increment index.

Definition at line 69 of file LexString.h.

References index.

LexString::operator const void *  )  const [inline]
 

Return non-NULL if characters still left and no error.

Definition at line 75 of file LexString.h.

References err, index, and len.

int LexString::operator!  )  const [inline]
 

Opposite of operator const void*.

Definition at line 81 of file LexString.h.

Boolean LexString::try_replace const char *  token  ) 
 

Try to match this at the current character with the construct The token must start with a '.'.

... Try to match this at the current character with the construct ... An example of a correct 'token' argument would be ... ".EQ.", which stands for the Fortran .EQ. operator. ... If this pattern is found at the current location, the ... periods are replaced by '[' and ']', so that .EQ. gets ... changed to [EQ], and then the current character is advanced ... to after the second brace. ... Returns True if a replacement took place. ... Precondition: *ls == '.' && token[0] == '.'

... If here, the dots already match. Try from the 2rd and on.

... We have a match. Replace dots, advance index, then return.

Definition at line 19 of file parser_prepass.cc.

References buf, False, index, and True.


Member Data Documentation

int LexString::index
 

Definition at line 7 of file LexString.h.

Referenced by LexString(), operator *(), operator const void *(), operator++(), peek(), try_replace(), and upper().

char* LexString::buf
 

Definition at line 8 of file LexString.h.

Referenced by LexString(), operator *(), peek(), try_replace(), and upper().

int LexString::len
 

Definition at line 9 of file LexString.h.

Referenced by LexString(), and operator const void *().

Boolean LexString::err
 

Definition at line 10 of file LexString.h.

Referenced by LexString(), and operator const void *().


The documentation for this class was generated from the following files:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:07:41 2005