• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kalzium/libscience

Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Parser Class Reference

#include <parser.h>

Inheritance diagram for Parser:
Inheritance graph
[legend]

Public Member Functions

 Parser ()
 
 Parser (const QString &_str)
 
virtual ~Parser ()
 
float floatVal () const
 
int intVal () const
 
int nextChar () const
 
int nextToken () const
 
void start (const QString &_str)
 

Protected Member Functions

int getNextChar ()
 
virtual int getNextToken ()
 
int skipWhitespace ()
 

Protected Attributes

double m_floatVal
 
int m_intVal
 
int m_nextToken
 

Static Protected Attributes

static const int FLOAT_TOKEN = 258
 
static const int INT_TOKEN = 257
 

Detailed Description

This is a general purpose parser originally written by Inge Wallin.

It is intended to be subclassed; see MoleculeParser.

Author
Inge Wallin

Definition at line 30 of file parser.h.

Constructor & Destructor Documentation

Parser::Parser ( )

Constructor.

Definition at line 21 of file parser.cpp.

Parser::Parser ( const QString &  _str)
explicit

Constructor.

Parameters
_strstart the parsing with _str

Definition at line 27 of file parser.cpp.

Parser::~Parser ( )
virtual

Destructor.

Definition at line 33 of file parser.cpp.

Member Function Documentation

float Parser::floatVal ( ) const
inline

Definition at line 68 of file parser.h.

int Parser::getNextChar ( )
protected

Make the next character the current one.

Definition at line 139 of file parser.cpp.

int Parser::getNextToken ( )
protectedvirtual

Fetches the next token.

Reimplemented in MoleculeParser.

Definition at line 184 of file parser.cpp.

int Parser::intVal ( ) const
inline

Get the value stored for different types of tokens.

Definition at line 67 of file parser.h.

int Parser::nextChar ( ) const
inline

Peek at the next character;.

Definition at line 57 of file parser.h.

int Parser::nextToken ( ) const
inline

Peek at the next token.

Definition at line 62 of file parser.h.

int Parser::skipWhitespace ( )
protected

Make the next non-space character the current one.

Definition at line 168 of file parser.cpp.

void Parser::start ( const QString &  _str)

Start a new parse.

Definition at line 39 of file parser.cpp.

Member Data Documentation

const int Parser::FLOAT_TOKEN = 258
staticprotected

All characters are their own token value per default.

Extend this list in your subclass to make a more advanced parser.

Definition at line 87 of file parser.h.

const int Parser::INT_TOKEN = 257
staticprotected

All characters are their own token value per default.

Extend this list in your subclass to make a more advanced parser.

Definition at line 81 of file parser.h.

double Parser::m_floatVal
protected

Valid if m_nextToken == FLOAT_TOKEN.

Definition at line 133 of file parser.h.

int Parser::m_intVal
protected

Valid if m_nextToken == INT_TOKEN.

Definition at line 128 of file parser.h.

int Parser::m_nextToken
protected

The next token to be used in the parser.

Definition at line 118 of file parser.h.


The documentation for this class was generated from the following files:
  • parser.h
  • parser.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:31 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalzium/libscience

Skip menu "kalzium/libscience"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal