~ubuntu-branches/ubuntu/maverick/ktechlab/maverick

« back to all changes in this revision

Viewing changes to microbe/microbe.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Georges Khaznadar
  • Date: 2009-02-09 00:28:49 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090209002849-9o8eqqiczqo4vat3
Tags: 0.3.6-4
modified debian/rules so it does not invoke make if there is no 
Makefile
Closes: #514552

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
2
 *   Copyright (C) 2004-2005 by Daniel Clarke   daniel.jc@gmail.com        *
3
3
 *   Copyright (C)      2005 by David Saxton                               *
 
4
 *                                                                         *
 
5
 *   24-04-2007                                                            *
 
6
 *   Modified to add pic 16f877,16f627 and 16f628                          *
 
7
 *   by george john george@space-kerala.org                                *
 
8
 *   supported by SPACE www.space-kerala.org                               *
4
9
 *                                                                         *
5
10
 *   This program is free software; you can redistribute it and/or modify  *
6
11
 *   it under the terms of the GNU General Public License as published by  *
70
75
}
71
76
 
72
77
 
73
 
QString Microbe::compile( const QString & url, bool showSource, bool optimize )
 
78
QString Microbe::compile( const QString & url, bool optimize )
74
79
{
75
80
        QFile file( url );
76
81
        if( file.open( IO_ReadOnly ) )
331
336
}
332
337
 
333
338
 
334
 
bool Microbe::isValidVariableName( const QString & variableName )
 
339
bool Microbe::isValidVariableName( const QString & variableName)
335
340
{
 
341
 
 
342
//*****modified checking is included for preventing the uses of registername as varable name*****
 
343
 
 
344
//Prevent usage of register/port name as varable
 
345
        if (/*PORT-NAME*/ variableName == "PORTA"
 
346
                || variableName == "PORTB"
 
347
                || variableName == "PORTC"
 
348
                || variableName == "PORTD"
 
349
                || variableName == "PORTE" /*TRIS-NAME*/
 
350
                || variableName == "TRISA"
 
351
                || variableName == "TRISB"
 
352
                || variableName == "TRISC"
 
353
                || variableName == "TRISD"
 
354
                || variableName == "TRISE" /**REGISTER-NAME**/
 
355
                || variableName == "TMR0"
 
356
                || variableName == "PCL"
 
357
                || variableName == "STATUS"
 
358
                || variableName == "FSR"
 
359
                || variableName == "PCLATH"
 
360
                || variableName == "INTCON"
 
361
                || variableName == "PIR1"
 
362
                || variableName == "PIR2"
 
363
                || variableName == "TMR1L"
 
364
                || variableName == "TMR1H"
 
365
                || variableName == "T1CON"
 
366
                || variableName == "TMR2"
 
367
                || variableName == "T2CON"
 
368
                || variableName == "SSPBUF"
 
369
                || variableName == "SSPCON"
 
370
                || variableName == "CCPR1L"
 
371
                || variableName == "CCPR1H"
 
372
                || variableName == "CCP1CON"
 
373
                || variableName == "RCSTA"
 
374
                || variableName == "TXREG"
 
375
                || variableName == "RCREG"
 
376
                || variableName == "CCPR2L"
 
377
                || variableName == "CCPR2H"
 
378
                || variableName == "CCP2CON"
 
379
                || variableName == "ADRESH"
 
380
                || variableName == "ADCON0" /*bank0ends*/
 
381
                || variableName == "OPTION_REG"
 
382
                || variableName == "PIE1"
 
383
                || variableName == "PIE2"
 
384
                || variableName == "PCON"
 
385
                || variableName == "SSPCON2"
 
386
                || variableName == "PR2"
 
387
                || variableName == "SSPADD"
 
388
                || variableName == "SSPSTAT"
 
389
                || variableName == "TXSTA"
 
390
                || variableName == "SPBRG"
 
391
                || variableName == "ADRESL"
 
392
                || variableName == "ADCON1" /*bank1ends*/
 
393
                || variableName == "EEDATA "
 
394
                || variableName == "EEADR"
 
395
                || variableName == "EEDATH"
 
396
                || variableName == "EEADRH" /*bank2ends*/
 
397
                || variableName == "EECON1"
 
398
                || variableName == "EECON2"  /*bank3ends*/ )
 
399
                        return false;
 
400
 
 
401
//****************************modification ends*******************************
 
402
 
336
403
        if ( variableName.isEmpty() )
337
404
                return false;
338
405