~ubuntu-branches/ubuntu/natty/geany/natty

« back to all changes in this revision

Viewing changes to scintilla/LexVHDL.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2010-08-07 03:23:12 UTC
  • mfrom: (1.4.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20100807032312-ot70ac9d50cn79we
Tags: upstream-0.19
ImportĀ upstreamĀ versionĀ 0.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// Scintilla source code edit control
2
2
/** @file LexVHDL.cxx
3
3
 ** Lexer for VHDL
4
 
 ** Written by Phil Reid, 
 
4
 ** Written by Phil Reid,
5
5
 ** Based on:
6
 
 **  - The Verilog Lexer by Avi Yegudin 
 
6
 **  - The Verilog Lexer by Avi Yegudin
7
7
 **  - The Fortran Lexer by Chuan-jian Shen
8
8
 **  - The C++ lexer by Neil Hodgson
9
9
 **/
126
126
        sc.SetState(SCE_VHDL_IDENTIFIER);
127
127
      } else if (sc.Match('-', '-')) {
128
128
        sc.SetState(SCE_VHDL_COMMENT);
129
 
        sc.Forward(); 
 
129
        sc.Forward();
130
130
      } else if (sc.Match('-', '-')) {
131
131
        if (sc.Match("--!"))  // Nice to have a different comment style
132
132
          sc.SetState(SCE_VHDL_COMMENTLINEBANG);
161
161
static void FoldNoBoxVHDLDoc(
162
162
  unsigned int startPos,
163
163
  int length,
164
 
  int initStyle,
 
164
  int,
165
165
  Accessor &styler)
166
166
{
167
167
  // Decided it would be smarter to have the lexer have all keywords included. Therefore I
249
249
  char  chPrev          = '\0';
250
250
  char  chNextNonBlank;
251
251
  int   styleNext       = styler.StyleAt(startPos);
252
 
  int   style           = initStyle;
253
252
  //Platform::DebugPrintf("Line[%04d] Prev[%20s] ************************* Level[%x]\n", lineCurrent+1, prevWord, levelCurrent);
254
253
 
255
254
  /***************************************/
265
264
      j ++ ;
266
265
      chNextNonBlank = styler.SafeGetCharAt(j);
267
266
    }
268
 
    style           = styleNext;
 
267
    int style           = styleNext;
269
268
    styleNext       = styler.StyleAt(i + 1);
270
269
    bool atEOL      = (ch == '\r' && chNext != '\n') || (ch == '\n');
271
270
 
272
 
                if (foldComment && atEOL && IsCommentLine(lineCurrent, styler)) 
 
271
                if (foldComment && atEOL && IsCommentLine(lineCurrent, styler))
273
272
    {
274
273
      if(!IsCommentLine(lineCurrent-1, styler) && IsCommentLine(lineCurrent+1, styler))
275
274
      {
276
275
        levelNext++;
277
 
      } 
 
276
      }
278
277
      else if(IsCommentLine(lineCurrent-1, styler) && !IsCommentLine(lineCurrent+1, styler))
279
278
      {
280
279
        levelNext--;
380
379
            ((strcmp(s, "begin") == 0) && (strcmp(prevWord, "function") == 0)) ||
381
380
            ((strcmp(s, "begin") == 0) && (strcmp(prevWord, "procedure") == 0)))
382
381
          {
383
 
            levelMinCurrentBegin = levelNext - 1;  
 
382
            levelMinCurrentBegin = levelNext - 1;
384
383
          }
385
384
          //Platform::DebugPrintf("Line[%04d] Prev[%20s] Cur[%20s] Level[%x]\n", lineCurrent+1, prevWord, s, levelCurrent);
386
385
          strcpy(prevWord, s);
444
443
 
445
444
 
446
445
// Keyword:
447
 
//    access after alias all architecture array assert attribute begin block body buffer bus case component 
448
 
//    configuration constant disconnect downto else elsif end entity exit file for function generate generic 
449
 
//    group guarded if impure in inertial inout is label library linkage literal loop map new next null of 
450
 
//    on open others out package port postponed procedure process pure range record register reject report 
451
 
//    return select severity shared signal subtype then to transport type unaffected units until use variable 
 
446
//    access after alias all architecture array assert attribute begin block body buffer bus case component
 
447
//    configuration constant disconnect downto else elsif end entity exit file for function generate generic
 
448
//    group guarded if impure in inertial inout is label library linkage literal loop map new next null of
 
449
//    on open others out package port postponed procedure process pure range record register reject report
 
450
//    return select severity shared signal subtype then to transport type unaffected units until use variable
452
451
//    wait when while with
453
452
//
454
453
// Operators:
455
454
//    abs and mod nand nor not or rem rol ror sla sll sra srl xnor xor
456
455
//
457
456
// Attributes:
458
 
//    left right low high ascending image value pos val succ pred leftof rightof base range reverse_range 
459
 
//    length delayed stable quiet transaction event active last_event last_active last_value driving 
 
457
//    left right low high ascending image value pos val succ pred leftof rightof base range reverse_range
 
458
//    length delayed stable quiet transaction event active last_event last_active last_value driving
460
459
//    driving_value simple_name path_name instance_name
461
460
//
462
461
// Std Functions:
463
 
//    now readline read writeline write endfile resolved to_bit to_bitvector to_stdulogic to_stdlogicvector 
464
 
//    to_stdulogicvector to_x01 to_x01z to_UX01 rising_edge falling_edge is_x shift_left shift_right rotate_left 
 
462
//    now readline read writeline write endfile resolved to_bit to_bitvector to_stdulogic to_stdlogicvector
 
463
//    to_stdulogicvector to_x01 to_x01z to_UX01 rising_edge falling_edge is_x shift_left shift_right rotate_left
465
464
//    rotate_right resize to_integer to_unsigned to_signed std_match to_01
466
465
//
467
466
// Std Packages:
468
 
//    std ieee work standard textio std_logic_1164 std_logic_arith std_logic_misc std_logic_signed 
469
 
//    std_logic_textio std_logic_unsigned numeric_bit numeric_std math_complex math_real vital_primitives 
 
467
//    std ieee work standard textio std_logic_1164 std_logic_arith std_logic_misc std_logic_signed
 
468
//    std_logic_textio std_logic_unsigned numeric_bit numeric_std math_complex math_real vital_primitives
470
469
//    vital_timing
471
470
//
472
471
// Std Types:
473
 
//    boolean bit character severity_level integer real time delay_length natural positive string bit_vector 
474
 
//    file_open_kind file_open_status line text side width std_ulogic std_ulogic_vector std_logic 
 
472
//    boolean bit character severity_level integer real time delay_length natural positive string bit_vector
 
473
//    file_open_kind file_open_status line text side width std_ulogic std_ulogic_vector std_logic
475
474
//    std_logic_vector X01 X01Z UX01 UX01Z unsigned signed
476
475
//
477
476