Logo Search packages:      
Sourcecode: ktechlab version File versions  Download package

void Microbe::compileError ( MistakeType  type,
const QString &  context,
const SourceLine sourceLine 
)

Adds the given compiler error at the file line number to the compilation report.

Definition at line 210 of file microbe.cpp.

References SourceLine::line(), and SourceLine::url().

Referenced by Parser::mistake().

{
      QString message;
      switch (type)
      {
            case UnknownStatement:
                  message = i18n("Unknown statement");
                  break;
            case InvalidPort:
                  message = i18n("Port '%1' is not supported by target PIC").arg(context);
                  break;
            case UnassignedPin:
                  message = i18n("Pin identifier was not followed by '='");
                  break;
            case NonHighLowPinState:
                  message = i18n("Pin state can only be 'high' or 'low'");
                  break;
            case UnassignedPort:
                  message = i18n("Invalid token '%1'. Port identifier should be followed by '='").arg(context);
                  break;
            case UnexpectedStatementBeforeBracket:
                  message = i18n("Unexpected statement before '{'");
                  break;
            case MismatchedBrackets:
                  message = i18n("Mismatched brackets in expression '%1'").arg(context);
                  break;
            case InvalidEquals:
                  message = i18n("Invalid '=' found in expression");
                  break;
            case ReservedKeyword:
                  message = i18n("Reserved keyword '%1' cannot be a variable name.").arg(context);
                  break;
            case ConsecutiveOperators:
                  message = i18n("Nothing between operators");
                  break;
            case MissingOperator:
                  message = i18n("Missing operator or space in operand");
                  break;
            case UnknownVariable:
                  if ( context.isEmpty() )
                        message = i18n("Unknown variable");
                  else
                        message = i18n("Unknown variable '%1'").arg(context);
                  break;
            case UnopenableInclude:
                  message = i18n("Could not open include file '%1'").arg(context);
                  break;
            case DivisionByZero:
                  message = i18n("Division by zero");
                  break;
            case NumberTooBig:
                  message = i18n("Number too big");
                  break;
            case NonConstantStep:
                  message = i18n("Step can only be a constant expression");
                  break;
            case NonConstantDelay:
                  message = i18n("Delay must be a positive constant value");
                  break;
            case HighLowExpected:
                  message = i18n("'high' or 'low' expected after pin expression '%1'").arg(context);
                  break;
            case InvalidComparison:
                  message = i18n("Comparison operator in '%1' is not recognized");
                  break;
            case SubBeforeEnd:
                  message = i18n("Subroutine definition before end of program");
                  break;
            case InterruptBeforeEnd:
                  message = i18n("Interrupt routine definition before end of program");
                  break;
            case LabelExpected:
                  message = i18n("Label expected");
                  break;
            case TooManyTokens:
                  message = i18n("Extra tokens at end of line");
                  break;
            case FixedStringExpected:
                  message = i18n("Expected '%1'").arg(context);
                  break;
            case PinListExpected:
                  message = i18n("Pin list expected");
                  break;
            case AliasRedefined:
                  message = i18n("Alias already definied");
                  break;
            case InvalidInterrupt:
                  message = i18n("Interrupt type not supported by target PIC");
                  break;
            case InterruptRedefined:
                  message = i18n("Interrupt already definied");
                  break;
            case ReadOnlyVariable:
                  message = i18n("Variable '%1' is read only").arg(context);
                  break;
            case WriteOnlyVariable:
                  message = i18n("Variable '%1' is write only").arg(context);
                  break;
            case InvalidPinMapSize:
                  message = i18n("Invalid pin list size");
                  break;
            case VariableRedefined:
                  message = i18n("Variable '%1' is already defined").arg(context);
                  break;
            case InvalidVariableName:
                  message = i18n("'%1' is not a valid variable name").arg(context);
                  break;
            case VariableExpected:
                  message = i18n("Variable expected");
                  break;
            case NameExpected:
                  message = i18n("Name expected");
                  break;
      }
      
      
      m_errorReport += QString("%1:%2:Error [%3] %4\n")
                  .arg( sourceLine.url() )
                  .arg( sourceLine.line()+1 )
                  .arg( type )
                  .arg( message );
}


Generated by  Doxygen 1.6.0   Back to index