Gui::InteractiveInterpreter Class Reference

This class implements an interactive Python interpreter. More...

#include <PythonConsole.h>

Public Member Functions

void clearBuffer ()
 
int compileCommand (const char *) const
 Compile a command and determine whether it is incomplete. More...
 
QStringList getBuffer () const
 
bool hasPendingInput (void) const
 
 InteractiveInterpreter ()
 
bool push (const char *)
 Store the line into the internal buffer and compile the total buffer. More...
 
void setBuffer (const QStringList &)
 
 ~InteractiveInterpreter ()
 

Detailed Description

This class implements an interactive Python interpreter.

Author
Werner Mayer

Constructor & Destructor Documentation

◆ InteractiveInterpreter()

InteractiveInterpreter::InteractiveInterpreter ( )

◆ ~InteractiveInterpreter()

InteractiveInterpreter::~InteractiveInterpreter ( )

Member Function Documentation

◆ clearBuffer()

void InteractiveInterpreter::clearBuffer ( )

◆ compileCommand()

int InteractiveInterpreter::compileCommand ( const char *  source) const

Compile a command and determine whether it is incomplete.

The source string may contain line feeds and/or carriage returns.
Return value:

  • Return 1 if the command is incomplete
  • Return 0 if the command is complete and valid
  • Return -1 if the command is a syntax error

(OverflowError and ValueError can be produced by malformed literals).

References Gui::InteractiveInterpreterP::interpreter.

◆ getBuffer()

QStringList InteractiveInterpreter::getBuffer ( ) const

◆ hasPendingInput()

bool InteractiveInterpreter::hasPendingInput ( void  ) const

◆ push()

bool InteractiveInterpreter::push ( const char *  line)

Store the line into the internal buffer and compile the total buffer.

In case it is a complete Python command the buffer is emptied.

References Gui::InteractiveInterpreterP::buffer.

◆ setBuffer()

void InteractiveInterpreter::setBuffer ( const QStringList &  buf)

The documentation for this class was generated from the following files: