KDevelop API Documentation

ANTLRUtil.cpp File Reference

#include <antlr/config.hpp>
#include <antlr/IOException.hpp>
#include <iostream>
#include <cctype>
#include <string>

Include dependency graph for ANTLRUtil.cpp:

Include dependency graph

Go to the source code of this file.

Functions

std::istream & eatwhite (std::istream &is)
 Eat whitespace from the input stream.
std::string read_string (std::istream &in)
 Read a string enclosed by '"' from a stream.
std::string read_identifier (std::istream &in)
void read_AttributeNValue (std::istream &in, std::string &attribute, std::string &value)
 Read a attribute="value" thing.


Function Documentation

std ::istream& eatwhite std::istream &  is  ) 
 

Eat whitespace from the input stream.

Parameters:
is the stream to read from

Definition at line 22 of file ANTLRUtil.cpp.

References ANTLR_USE_NAMESPACE.

Referenced by read_identifier(), and read_string().

void read_AttributeNValue std::istream &  in,
std::string &  attribute,
std::string &  value
 

Read a attribute="value" thing.

Leading whitespace is skipped. Between attribute and '=' no whitespace is allowed. After the '=' it is permitted.

Parameters:
in the istream to read from.
attribute string the attribute name is put in
value string the value of the attribute is put in
Exceptions:
IOException if something is fishy. E.g. malformed quoting or missing '='

Definition at line 148 of file ANTLRUtil.cpp.

References read_identifier(), and read_string().

std ::string read_identifier std::istream &  in  ) 
 

Definition at line 112 of file ANTLRUtil.cpp.

References ANTLR_USE_NAMESPACE, and eatwhite().

Referenced by read_AttributeNValue().

std ::string read_string std::istream &  in  ) 
 

Read a string enclosed by '"' from a stream.

Also handles escaping of \". Skips leading whitespace.

Parameters:
in the istream to read from.
Returns:
the string read from file exclusive the '"'
Exceptions:
IOException if string is badly formatted

Definition at line 46 of file ANTLRUtil.cpp.

References ANTLR_USE_NAMESPACE, and eatwhite().

Referenced by read_AttributeNValue().

KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:28:19 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003