Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

/home/r0/dav/atlas.dir/atlas3/sources/interface/commands.cpp File Reference

#include "commands.h"
#include <cstring>
#include <iostream>
#include <sstream>
#include <stack>
#include "error.h"

Include dependency graph for commands.cpp:

Include dependency graph

Go to the source code of this file.

Namespaces

namespace  atlas
namespace  atlas::commands

Functions

void ambiguous (const std::vector< const char * > &, const char *)
void execute (const char *name, const CommandMode *mode)
const char * getCommand (const CommandMode *mode)
std::istream & getInteractive (std::istream &, std::string &, const char *)
bool isEqual (const char *a, const char *b)
bool isInitial (const char *a, const char *b)
void activate (const CommandMode &mode)
void addCommands (CommandMode &dest, const CommandMode &source)
CheckResult checkName (const CommandMode &mode, const char *name)
input::InputBuffer & currentLine ()
const CommandMode * currentMode ()
void defaultError (const char *str)
void exitInteractive ()
void exitMode ()
void insertTag (TagDict &t, const char *name, const char *tag)
void printTags (std::ostream &strm, const TagDict &t)
void run (const CommandMode &initMode)
void ambiguous (const std::vector< const char * > &ext, const char *name)
void execute (const char *name, const CommandMode *mode)
 Execute the command "name". Also install default error handling.
const char * getCommand (const CommandMode *mode)
std::istream & getInteractive (std::istream &strm, std::string &name, const char *prompt)

Variables

std::stack< const CommandMode * > modeStack
std::stack< const char * > commandStack
input::InputBuffer commandLine
bool runFlag


Function Documentation

void atlas::commands::activate const CommandMode &  mode  ) 
 

Definition at line 254 of file commands.cpp.

References atlas::commands::CommandMode::entry(), and atlas::modeStack.

Referenced by atlas::execute(), atlas::help_f(), atlas::realform_f(), atlas::commands::run(), and atlas::type_f().

void atlas::commands::addCommands CommandMode &  dest,
const CommandMode &  source
 

Definition at line 270 of file commands.cpp.

References atlas::commands::CommandMode::add(), atlas::commands::CommandMode::begin(), and atlas::commands::CommandMode::end().

Referenced by atlas::blockmode::blockMode(), atlas::mainmode::mainMode(), and atlas::realmode::realMode().

void ambiguous const std::vector< const char * > &  ext,
const char *  name
[static]
 

Definition at line 469 of file commands.cpp.

References atlas::commands::CommandMode::end().

void ambiguous const std::vector< const char * > &  ,
const char * 
[static]
 

Referenced by atlas::commands::checkName(), and atlas::commands::run().

CheckResult atlas::commands::checkName const CommandMode &  mode,
const char *  name
 

Definition at line 280 of file commands.cpp.

References atlas::ambiguous(), atlas::commands::CheckResult, atlas::commands::CommandMode::end(), atlas::commands::CommandMode::extensions(), and atlas::commands::CommandMode::findName().

input::InputBuffer & atlas::commands::currentLine  ) 
 

Definition at line 303 of file commands.cpp.

const CommandMode * atlas::commands::currentMode  ) 
 

Definition at line 321 of file commands.cpp.

References atlas::modeStack.

Referenced by atlas::completionGenerator().

void atlas::commands::defaultError const char *  str  ) 
 

Definition at line 333 of file commands.cpp.

void execute const char *  name,
const CommandMode *  mode
[static]
 

Execute the command "name". Also install default error handling.

Precondition: name is defined either in the current mode or in one of its descendants.

If name is found in the current mode, we simply execute it. Otherwise, we find out in which descendant mode it is found, we attempt the mode change, and in case of success, push command on the stack, so that it will be executed at the next loop in |run|.

Definition at line 497 of file commands.cpp.

References atlas::commands::activate(), atlas::commandStack, atlas::commands::CommandMode::end(), atlas::commands::CommandMode::find(), atlas::commands::CommandMode::findName(), atlas::commands::CommandMode::n_desc(), and atlas::commands::CommandMode::nextMode().

void execute const char *  name,
const CommandMode *  mode
[static]
 

Referenced by atlas::commands::run().

void atlas::commands::exitInteractive  ) 
 

Definition at line 345 of file commands.cpp.

References atlas::commands::exitMode(), atlas::modeStack, and atlas::runFlag.

void atlas::commands::exitMode  ) 
 

Definition at line 358 of file commands.cpp.

References atlas::commands::CommandMode::exit(), and atlas::modeStack.

Referenced by atlas::commands::exitInteractive(), atlas::realform_f(), and atlas::type_f().

const char* getCommand const CommandMode *  mode  )  [static]
 

Definition at line 538 of file commands.cpp.

References atlas::commandStack, atlas::getInteractive(), and atlas::commands::CommandMode::prompt().

const char* getCommand const CommandMode *  mode  )  [static]
 

Referenced by atlas::commands::run().

std::istream& getInteractive std::istream &  strm,
std::string &  name,
const char *  prompt
[static]
 

Definition at line 563 of file commands.cpp.

References atlas::commandLine, and atlas::input::InputBuffer::getline().

std::istream& getInteractive std::istream &  ,
std::string &  ,
const char * 
[static]
 

Referenced by atlas::interactive::getCartanClass(), atlas::getCommand(), atlas::interactive::getInnerClass(), and atlas::interactive::getInteractive().

void atlas::commands::insertTag TagDict t,
const char *  name,
const char *  tag
 

Definition at line 372 of file commands.cpp.

Referenced by atlas::blockmode::addBlockHelp(), atlas::emptyhelp::addEmptyHelp(), atlas::mainhelp::addMainHelp(), atlas::realhelp::addRealHelp(), atlas::special::addSpecialHelp(), and atlas::helpmode::helpMode().

bool isEqual const char *  a,
const char *  b
[inline, static]
 

Definition at line 67 of file commands.cpp.

Referenced by atlas::commands::run().

bool isInitial const char *  a,
const char *  b
[inline, static]
 

Definition at line 71 of file commands.cpp.

Referenced by atlas::commands::CommandMode::extensions().

void atlas::commands::printTags std::ostream &  strm,
const TagDict t
 

Definition at line 382 of file commands.cpp.

References atlas::commands::CommandMode::end().

Referenced by atlas::questionMark_h().

void atlas::commands::run const CommandMode &  initMode  ) 
 

Definition at line 407 of file commands.cpp.

References atlas::commands::activate(), atlas::ambiguous(), atlas::commands::CommandMode::error(), atlas::execute(), atlas::commands::CommandMode::extensions(), atlas::getCommand(), atlas::isEqual(), atlas::modeStack, and atlas::runFlag.

Referenced by main().


Variable Documentation

input::InputBuffer atlas::commandLine [static]
 

Definition at line 54 of file commands.cpp.

Referenced by atlas::getInteractive().

std::stack<const char*> atlas::commandStack [static]
 

Definition at line 52 of file commands.cpp.

Referenced by atlas::execute(), and atlas::getCommand().

std::stack<const CommandMode*> atlas::modeStack [static]
 

Definition at line 48 of file commands.cpp.

Referenced by atlas::commands::activate(), atlas::commands::currentMode(), atlas::commands::exitInteractive(), atlas::commands::exitMode(), and atlas::commands::run().

bool atlas::runFlag [static]
 

Definition at line 56 of file commands.cpp.

Referenced by atlas::commands::exitInteractive(), and atlas::commands::run().


Generated on Wed Mar 26 16:50:01 2008 for atlas by  doxygen 1.3.9.1