home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Programming / jikes-1.02 / src / semantic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-05  |  56.7 KB  |  1,275 lines

  1. // $Id: semantic.h,v 1.21 1999/09/01 14:58:25 shields Exp $
  2. //
  3. // This software is subject to the terms of the IBM Jikes Compiler
  4. // License Agreement available at the following URL:
  5. // http://www.ibm.com/research/jikes.
  6. // Copyright (C) 1996, 1998, International Business Machines Corporation
  7. // and others.  All Rights Reserved.
  8. // You must accept the terms of that agreement to use this software.
  9. //
  10. #ifndef semantic_INCLUDED
  11. #define semantic_INCLUDED
  12.  
  13. #include "config.h"
  14. #ifndef __amigaos__
  15. #include <wchar.h>
  16. #endif
  17. #include "ast.h"
  18. #include "diagnose.h"
  19. #include "error.h"
  20. #include "symbol.h"
  21. #include "control.h"
  22. #include "tuple.h"
  23. #include "set.h"
  24.  
  25. class cp_info;
  26. class TypeShadowSymbol;
  27.  
  28. //
  29. //
  30. //
  31. class SymbolTableStack
  32. {
  33. public:
  34.     void Push(SymbolTable *symtab) { table.Next() = symtab; }
  35.     void Pop()                     { if (table.Length() > 0) table.Reset(table.Length() - 1); }
  36.     int Size()                     { return table.Length(); }
  37.     SymbolTable *Top()             { return (SymbolTable *) (table.Length() > 0 ? table[table.Length() - 1] : NULL); }
  38.  
  39.     SymbolTable *operator[](const int i) { return table[i]; } /*  */
  40.  
  41.     //
  42.     // Search for a variable in a stack of symbol tables starting at the current symbol table
  43.     // and ending with the symbol table of the method from which this call originates.
  44.     //
  45.     VariableSymbol *FindVariableSymbol(NameSymbol *name_symbol)
  46.     {
  47.         for (int i = table.Length() - 1; i >= 0; i--)
  48.         {
  49.             VariableSymbol *symbol = table[i] -> FindVariableSymbol(name_symbol);
  50.             if (symbol)
  51.                 return symbol;
  52.         }
  53.         return (VariableSymbol *) NULL;
  54.     }
  55.  
  56.     //
  57.     // Search for a type in a stack of symbol tables starting at the current symbol table
  58.     // and ending with the symbol table of the method from which this call originates.
  59.     //
  60.     TypeSymbol* FindTypeSymbol(NameSymbol *name_symbol)
  61.     {
  62.         for (int i = table.Length() - 1; i >= 0; i--)
  63.         {
  64.             TypeSymbol *symbol = table[i] -> FindTypeSymbol(name_symbol);
  65.             if (symbol)
  66.                 return symbol;
  67.         }
  68.         return (TypeSymbol *) NULL;
  69.     }
  70.  
  71.     //
  72.     // Search for a label in a stack of symbol tables starting at the current symbol table
  73.     // and ending with the symbol table of the method from which this call originates.
  74.     //
  75.     LabelSymbol* FindLabelSymbol(NameSymbol *name_symbol)
  76.     {
  77.         for (int i = table.Length() - 1; i >= 0; i--)
  78.         {
  79.             LabelSymbol *label = table[i] -> FindLabelSymbol(name_symbol);
  80.             if (label)
  81.                 return label;
  82.         }
  83.         return (LabelSymbol *) NULL;
  84.     }
  85.  
  86. private:
  87.     Tuple<SymbolTable *> table;
  88. };
  89.  
  90.  
  91. //
  92. //
  93. //
  94. class ExceptionTableStack
  95. {
  96. public:
  97.     void Push(SymbolSet *set) { table.Next() = set; }
  98.     void       Pop()          { if (table.Length() > 0) table.Reset(table.Length() - 1); }
  99.     int        Size()         { return table.Length(); }
  100.     SymbolSet *Top()          { return (SymbolSet *) (table.Length() > 0 ? table[table.Length() - 1] : NULL); }
  101.  
  102. private:
  103.     Tuple<SymbolSet *> table;
  104. };
  105.  
  106.  
  107. //
  108. //
  109. //
  110. class StatementStack
  111. {
  112. public:
  113.     void Push(Ast *stmt) { info.Next() = stmt; }
  114.     void Pop()           { if (info.Length() > 0) info.Reset(info.Length() - 1); }
  115.     int Size()           { return info.Length(); }
  116.     Ast *Top()           { return (Ast *) (info.Length() > 0 ? info[info.Length() - 1] : NULL); }
  117.  
  118.     Ast *operator[](const int i) { return info[i]; }
  119.  
  120. private:
  121.     Tuple<Ast *> info;
  122. };
  123.  
  124.  
  125. //
  126. //
  127. //
  128. class BlockStack
  129. {
  130. public:
  131.     int max_size;
  132.  
  133.     void Push(AstBlock *block_)
  134.     {
  135.         block.Next() = block_;
  136.         index.Next() = 0;
  137.         if (block.Length() > max_size)
  138.             max_size = block.Length();
  139.     }
  140.  
  141.     void Pop()
  142.     {
  143.         int len = block.Length() - 1;
  144.         if (len >= 0)
  145.         {
  146.             block.Reset(len);
  147.             index.Reset(len);
  148.         }
  149.     }
  150.  
  151.     int Size() { return block.Length(); }
  152.     AstBlock *TopBlock() { return (AstBlock *) (block.Length() > 0 ? block[block.Length() - 1] : NULL); }
  153.  
  154.     AstBlock *operator[](const int i) { return block[i]; }
  155.  
  156.     int &TopMaxEnclosedVariableIndex()
  157.     {
  158.         if (index.Length() <= 0)
  159.             assert(false);
  160.         return index[index.Length() - 1];
  161.     }
  162.  
  163.     BlockStack() : max_size(0) {}
  164.  
  165. private:
  166.     Tuple<AstBlock *> block;
  167.     Tuple<int> index;
  168. };
  169.  
  170.  
  171. //
  172. //
  173. //
  174. class DefiniteFinalAssignmentStack
  175. {
  176. public:
  177.     void Push() { info.Next().Reset(); }
  178.     void Pop()  { if (info.Length() > 0) info.Reset(info.Length() - 1); }
  179.     int Size()  { return info.Length(); }
  180.     Tuple <AstExpression *> &Top()  { if (info.Length() == 0) assert(false); return info[info.Length() - 1]; }
  181.  
  182. private:
  183.     Tuple< Tuple<AstExpression *> > info;
  184. };
  185.  
  186.  
  187. //
  188. //
  189. //
  190. class DefiniteSets
  191. {
  192. public:
  193.     DefiniteSets(int set_size) : break_set(set_size),
  194.                                  continue_set(set_size),
  195.                                  return_set(set_size),
  196.                                  throw_set(set_size)
  197.     {}
  198.  
  199.     BitSet break_set,
  200.            continue_set,
  201.            return_set,
  202.            throw_set;
  203.  
  204.     void UniverseInit()
  205.     {
  206.         break_set.SetUniverse();
  207.         continue_set.SetUniverse();
  208.         return_set.SetUniverse();
  209.         throw_set.SetUniverse();
  210.     }
  211.  
  212.     void EmptyInit()
  213.     {
  214.         break_set.SetEmpty();
  215.         continue_set.SetEmpty();
  216.         return_set.SetEmpty();
  217.         throw_set.SetEmpty();
  218.     }
  219. };
  220.  
  221.  
  222. //
  223. //
  224. //
  225. class DefiniteBlockStack
  226. {
  227. public:
  228.  
  229.     void Push(AstBlock *block_)
  230.     {
  231.         definite_sets[top_index] -> UniverseInit();
  232.         final_sets[top_index] -> EmptyInit();
  233.  
  234.         block[top_index] = block_;
  235.         top_index++;
  236.     }
  237.  
  238.     void Pop()
  239.     {
  240.         if (top_index > 0)
  241.              top_index--;
  242.         else assert(false);
  243.     }
  244.  
  245.     int Size()                 { return top_index; }
  246.     AstBlock *Block(int i)     { return block[i]; }
  247.     AstBlock *TopBlock()       { assert(top_index > 0); return block[top_index - 1]; }
  248.  
  249.     BitSet &BreakSet(int i)    { return definite_sets[i] -> break_set; }
  250.     BitSet &ContinueSet(int i) { return definite_sets[i] -> continue_set; }
  251.     BitSet &ReturnSet(int i)   { return definite_sets[i] -> return_set; }
  252.     BitSet &ThrowSet(int i)    { return definite_sets[i] -> throw_set; }
  253.  
  254.     BitSet &TopBreakSet()      { assert(top_index > 0); return definite_sets[top_index - 1] -> break_set; }
  255.     BitSet &TopContinueSet()   { assert(top_index > 0); return definite_sets[top_index - 1] -> continue_set; }
  256.     BitSet &TopReturnSet()     { assert(top_index > 0); return definite_sets[top_index - 1] -> return_set; }
  257.     BitSet &TopThrowSet()      { assert(top_index > 0); return definite_sets[top_index - 1] -> throw_set; }
  258.  
  259.     BitSet &TopExitSet(BitSet &start_set)
  260.     {
  261.         assert(top_index > 0);
  262.  
  263.         exit_set  = start_set;
  264.         exit_set *= TopBreakSet();
  265.         exit_set *= TopContinueSet();
  266.         exit_set *= TopReturnSet();
  267.         exit_set *= TopThrowSet();
  268.  
  269.         return exit_set;
  270.     }
  271.  
  272.     BitSet &FinalBreakSet(int i)    { return final_sets[i] -> break_set; }
  273.     BitSet &FinalContinueSet(int i) { return final_sets[i] -> continue_set; }
  274.     BitSet &FinalReturnSet(int i)   { return final_sets[i] -> return_set; }
  275.     BitSet &FinalThrowSet(int i)    { return final_sets[i] -> throw_set; }
  276.  
  277.     BitSet &TopFinalBreakSet()      { assert(top_index > 0); return final_sets[top_index - 1] -> break_set; }
  278.     BitSet &TopFinalContinueSet()   { assert(top_index > 0); return final_sets[top_index - 1] -> continue_set; }
  279.     BitSet &TopFinalReturnSet()     { assert(top_index > 0); return final_sets[top_index - 1] -> return_set; }
  280.     BitSet &TopFinalThrowSet()      { assert(top_index > 0); return final_sets[top_index - 1] -> throw_set; }
  281.  
  282.     BitSet &TopFinalExitSet(BitSet &start_set)
  283.     {
  284.         assert(top_index > 0);
  285.  
  286.         exit_set  = start_set;
  287.         exit_set += TopFinalBreakSet();
  288.         exit_set += TopFinalContinueSet();
  289.         exit_set += TopFinalReturnSet();
  290.         exit_set += TopFinalThrowSet();
  291.  
  292.         return exit_set;
  293.     }
  294.  
  295.     DefiniteBlockStack(int stack_size_, int set_size) : stack_size(stack_size_),
  296.                                                         top_index(0),
  297.                                                         exit_set(set_size)
  298.     {
  299.         block = new AstBlock*[stack_size];
  300.         definite_sets = new DefiniteSets*[stack_size];
  301.         final_sets = new DefiniteSets*[stack_size];
  302.  
  303.         for (int i = 0; i < stack_size; i++)
  304.         {
  305.             definite_sets[i] = new DefiniteSets(set_size);
  306.             final_sets[i] = new DefiniteSets(set_size);
  307.         }
  308.     }
  309.  
  310.     ~DefiniteBlockStack()
  311.     {
  312.         delete [] block;
  313.         for (int i = 0; i < stack_size; i++)
  314.         {
  315.             delete definite_sets[i];
  316.             delete final_sets[i];
  317.         }
  318.  
  319.         delete [] definite_sets;
  320.         delete [] final_sets;
  321.     }
  322.  
  323. private:
  324.  
  325.     int stack_size,
  326.         top_index;
  327.     AstBlock **block;
  328.  
  329.     DefiniteSets **definite_sets,
  330.                  **final_sets;
  331.  
  332.     BitSet exit_set;
  333. };
  334.  
  335.  
  336. //
  337. //
  338. //
  339. class DefiniteTryStack
  340. {
  341. public:
  342.  
  343.     void Push(AstTryStatement *try_statement_)
  344.     {
  345.         this -> try_statement[top_index] = try_statement_;
  346.         top_index++;
  347.     }
  348.  
  349.     void Pop()
  350.     {
  351.         if (top_index > 0)
  352.              top_index--;
  353.         else assert(false);
  354.     }
  355.  
  356.     int Size()                           { return top_index; }
  357.     AstTryStatement *TryStatement(int i) { return try_statement[i]; }
  358.     AstBlock *Block(int i)               { return block[i]; }
  359.     AstBlock *TopBlock()                 { assert(top_index > 0); return block[top_index - 1]; }
  360.     void SetTopBlock(AstBlock *block_)   { assert(top_index > 0); block[top_index - 1] = block_; }
  361.  
  362.     DefiniteTryStack(int stack_size_) : stack_size(stack_size_),
  363.                                         top_index(0)
  364.     {
  365.         block = new AstBlock*[stack_size];
  366.         try_statement = new AstTryStatement*[stack_size];
  367.     }
  368.  
  369.     ~DefiniteTryStack()
  370.     {
  371.         delete [] block;
  372.         delete [] try_statement;
  373.     }
  374.  
  375. private:
  376.  
  377.     int stack_size,
  378.         top_index;
  379.     AstBlock **block;
  380.     AstTryStatement **try_statement;
  381. };
  382.  
  383.  
  384. //
  385. //
  386. //
  387. class SemanticEnvironment
  388. {
  389. public:
  390.  
  391.     Semantic *sem;
  392.     SemanticEnvironment *previous;
  393.  
  394.     MethodSymbol   *this_method;
  395.     VariableSymbol *this_variable;
  396.     Ast            *explicit_constructor_invocation;
  397.     Ast            *ast_construct;
  398.  
  399.     SymbolTableStack symbol_table; // Points to symbol table on top of stack
  400.     ExceptionTableStack try_exception_table_stack;
  401.     StatementStack try_statement_stack,
  402.                    breakable_statement_stack,
  403.                    continuable_statement_stack;
  404.     BlockStack block_stack;
  405.  
  406.     SemanticEnvironment(Semantic *sem_, TypeSymbol *type_, SemanticEnvironment *previous_ = NULL)
  407.             : sem(sem_),
  408.               _type(type_),
  409.               previous(previous_),
  410.               next(NULL),
  411.  
  412.               this_method(NULL),
  413.               this_variable(NULL),
  414.               explicit_constructor_invocation(NULL),
  415.               ast_construct(NULL)
  416.     {}
  417.  
  418.  
  419.     ~SemanticEnvironment()
  420.     {
  421.         delete next; // if there was any clone, get rid of it
  422.     }
  423.  
  424.     //
  425.     // Clone the immediate environment of "this" Semantic environment.
  426.     // The immediate environment consists primarily of the stack of symbol
  427.     // tables that are necessary for looking up local variables in the immediate
  428.     // environment.
  429.     //
  430.     SemanticEnvironment *GetEnvironment(Ast *ast)
  431.     {
  432.         SemanticEnvironment *clone = new SemanticEnvironment(sem, _type, NULL);
  433.         clone -> this_method = this -> this_method;
  434.         clone -> this_variable = this -> this_variable;
  435.         clone -> ast_construct = ast;
  436.         for (int i = 0; i < this -> symbol_table.Size(); i++)
  437.             clone -> symbol_table.Push(this -> symbol_table[i]);
  438.         clone -> next = this -> next;
  439.         this -> next = clone;
  440.  
  441.         return clone;
  442.     }
  443.  
  444.     TypeSymbol *Type() { return _type; }
  445.  
  446.     //
  447.     // Are we in a static area ?
  448.     //
  449.     inline bool StaticRegion()
  450.     {
  451.         return (this_variable && this_variable -> ACC_STATIC()) ||
  452.                (this_method   && this_method -> ACC_STATIC())   ||
  453.                (_type -> ACC_INTERFACE());
  454.     }
  455.  
  456. private:
  457.     TypeSymbol *_type;
  458.     SemanticEnvironment *next; // use to link an environment to its clones.
  459. };
  460.  
  461.  
  462. //
  463. //
  464. //
  465. class SemanticEnvironmentStack
  466. {
  467. public:
  468.     void Push(SemanticEnvironment *env) { info.Next() = env; }
  469.  
  470.     void Pop()
  471.     {
  472.         if (info.Length() > 0)
  473.             info.Reset(info.Length() - 1);
  474.  
  475.         return;
  476.     }
  477.  
  478.     int Size() { return info.Length(); }
  479.  
  480.     SemanticEnvironment *Top() { return (SemanticEnvironment *) (info.Length() > 0 ? info[info.Length() - 1] : NULL); }
  481.  
  482.     SemanticEnvironment *operator[](const int i) { return info[i]; }
  483.  
  484. private:
  485.     Tuple<SemanticEnvironment *> info;
  486. };
  487.  
  488.  
  489. class Semantic
  490. {
  491. public:
  492.     //
  493.     //
  494.     //
  495.     Control &control;
  496.     FileSymbol *source_file_symbol;
  497.     LexStream *lex_stream;
  498.     AstCompilationUnit *compilation_unit;
  499.     DirectorySymbol *directory_symbol;
  500.  
  501.     SymbolSet types_to_be_processed;
  502.  
  503.     int return_code;
  504.  
  505.     PackageSymbol *Package() { return this_package; }
  506.  
  507.     void CheckPackage();
  508.     void ProcessTypeNames();
  509.     void ProcessImports();
  510.     void ProcessSuperTypeDependences(AstClassDeclaration *);
  511.     void ProcessSuperTypeDependences(AstInterfaceDeclaration *);
  512.  
  513.     LiteralValue *ComputeFinalValue(AstVariableDeclarator *);
  514.  
  515.     Semantic(Control &control_, FileSymbol *file_symbol_) : control(control_),
  516.                                                             source_file_symbol(file_symbol_),
  517.                                                             compilation_unit(file_symbol_ -> compilation_unit),
  518.                                                             lex_stream(file_symbol_ -> lex_stream),
  519.                                                             directory_symbol(file_symbol_ -> directory_symbol),
  520.                                                             this_package(file_symbol_ -> package),
  521.                                                             return_code(0),
  522.                                                             error(NULL),
  523.                                                             definitely_assigned_variables(NULL),
  524.                                                             universe(NULL),
  525.                                                             definite_block_stack(NULL),
  526.                                                             definite_try_stack(NULL),
  527.                                                             definite_final_assignment_stack(NULL),
  528.                                                             definite_visible_variables(NULL),
  529.                                                             possibly_assigned_finals(NULL)
  530.     {
  531.         ProcessExprOrStmt[Ast::LOCAL_VARIABLE_DECLARATION] = &Semantic::ProcessLocalVariableDeclarationStatement;
  532.         ProcessExprOrStmt[Ast::BLOCK]                      = &Semantic::ProcessBlock;
  533.         ProcessExprOrStmt[Ast::EXPRESSION_STATEMENT]       = &Semantic::ProcessExpressionStatement;
  534.         ProcessExprOrStmt[Ast::SYNCHRONIZED_STATEMENT]     = &Semantic::ProcessSynchronizedStatement;
  535.         ProcessExprOrStmt[Ast::IF]                         = &Semantic::ProcessIfStatement;
  536.         ProcessExprOrStmt[Ast::WHILE]                      = &Semantic::ProcessWhileStatement;
  537.         ProcessExprOrStmt[Ast::FOR]                        = &Semantic::ProcessForStatement;
  538.         ProcessExprOrStmt[Ast::SWITCH]                     = &Semantic::ProcessSwitchStatement;
  539.         ProcessExprOrStmt[Ast::DO]                         = &Semantic::ProcessDoStatement;
  540.         ProcessExprOrStmt[Ast::BREAK]                      = &Semantic::ProcessBreakStatement;
  541.         ProcessExprOrStmt[Ast::CONTINUE]                   = &Semantic::ProcessContinueStatement;
  542.         ProcessExprOrStmt[Ast::RETURN]                     = &Semantic::ProcessReturnStatement;
  543.         ProcessExprOrStmt[Ast::THROW]                      = &Semantic::ProcessThrowStatement;
  544.         ProcessExprOrStmt[Ast::TRY]                        = &Semantic::ProcessTryStatement;
  545.         ProcessExprOrStmt[Ast::EMPTY_STATEMENT]            = &Semantic::ProcessEmptyStatement;
  546.         ProcessExprOrStmt[Ast::CLASS]                      = &Semantic::ProcessClassDeclaration;
  547.  
  548.         ProcessExprOrStmt[Ast::IDENTIFIER]               = &Semantic::ProcessSimpleName;
  549.         ProcessExprOrStmt[Ast::DOT]                      = &Semantic::ProcessFieldAccess;
  550.         ProcessExprOrStmt[Ast::INTEGER_LITERAL]          = &Semantic::ProcessIntegerLiteral;
  551.         ProcessExprOrStmt[Ast::LONG_LITERAL]             = &Semantic::ProcessLongLiteral;
  552.         ProcessExprOrStmt[Ast::FLOATING_POINT_LITERAL]   = &Semantic::ProcessFloatingPointLiteral;
  553.         ProcessExprOrStmt[Ast::DOUBLE_LITERAL]           = &Semantic::ProcessDoubleLiteral;
  554.         ProcessExprOrStmt[Ast::TRUE_LITERAL]             = &Semantic::ProcessTrueLiteral;
  555.         ProcessExprOrStmt[Ast::FALSE_LITERAL]            = &Semantic::ProcessFalseLiteral;
  556.         ProcessExprOrStmt[Ast::STRING_LITERAL]           = &Semantic::ProcessStringLiteral;
  557.         ProcessExprOrStmt[Ast::CHARACTER_LITERAL]        = &Semantic::ProcessCharacterLiteral;
  558.         ProcessExprOrStmt[Ast::NULL_LITERAL]             = &Semantic::ProcessNullLiteral;
  559.         ProcessExprOrStmt[Ast::ARRAY_ACCESS]             = &Semantic::ProcessArrayAccess;
  560.         ProcessExprOrStmt[Ast::CALL]                     = &Semantic::ProcessMethodInvocation;
  561.         ProcessExprOrStmt[Ast::THIS_EXPRESSION]          = &Semantic::ProcessThisExpression;
  562.         ProcessExprOrStmt[Ast::SUPER_EXPRESSION]         = &Semantic::ProcessSuperExpression;
  563.         ProcessExprOrStmt[Ast::PARENTHESIZED_EXPRESSION] = &Semantic::ProcessParenthesizedExpression;
  564.         ProcessExprOrStmt[Ast::CLASS_CREATION]           = &Semantic::ProcessClassInstanceCreationExpression;
  565.         ProcessExprOrStmt[Ast::ARRAY_CREATION]           = &Semantic::ProcessArrayCreationExpression;
  566.         ProcessExprOrStmt[Ast::POST_UNARY]               = &Semantic::ProcessPostUnaryExpression;
  567.         ProcessExprOrStmt[Ast::PRE_UNARY]                = &Semantic::ProcessPreUnaryExpression;
  568.         ProcessExprOrStmt[Ast::CAST]                     = &Semantic::ProcessCastExpression;
  569.         ProcessExprOrStmt[Ast::BINARY]                   = &Semantic::ProcessBinaryExpression;
  570.         ProcessExprOrStmt[Ast::TYPE]                     = &Semantic::ProcessTypeExpression;
  571.         ProcessExprOrStmt[Ast::CONDITIONAL]              = &Semantic::ProcessConditionalExpression;
  572.         ProcessExprOrStmt[Ast::ASSIGNMENT]               = &Semantic::ProcessAssignmentExpression;
  573.  
  574.         DefiniteStmt[Ast::LOCAL_VARIABLE_DECLARATION] = &Semantic::DefiniteLocalVariableDeclarationStatement;
  575.         DefiniteStmt[Ast::BLOCK]                      = &Semantic::DefiniteBlock;
  576.         DefiniteStmt[Ast::EXPRESSION_STATEMENT]       = &Semantic::DefiniteExpressionStatement;
  577.         DefiniteStmt[Ast::SYNCHRONIZED_STATEMENT]     = &Semantic::DefiniteSynchronizedStatement;
  578.         DefiniteStmt[Ast::IF]                         = &Semantic::DefiniteIfStatement;
  579.         DefiniteStmt[Ast::WHILE]                      = &Semantic::DefiniteWhileStatement;
  580.         DefiniteStmt[Ast::FOR]                        = &Semantic::DefiniteForStatement;
  581.         DefiniteStmt[Ast::SWITCH]                     = &Semantic::DefiniteSwitchStatement;
  582.         DefiniteStmt[Ast::DO]                         = &Semantic::DefiniteDoStatement;
  583.         DefiniteStmt[Ast::BREAK]                      = &Semantic::DefiniteBreakStatement;
  584.         DefiniteStmt[Ast::CONTINUE]                   = &Semantic::DefiniteContinueStatement;
  585.         DefiniteStmt[Ast::RETURN]                     = &Semantic::DefiniteReturnStatement;
  586.         DefiniteStmt[Ast::THROW]                      = &Semantic::DefiniteThrowStatement;
  587.         DefiniteStmt[Ast::TRY]                        = &Semantic::DefiniteTryStatement;
  588.         DefiniteStmt[Ast::EMPTY_STATEMENT]            = &Semantic::DefiniteEmptyStatement;
  589.         DefiniteStmt[Ast::CLASS]                      = &Semantic::DefiniteClassDeclaration;
  590.  
  591.         DefiniteExpr[Ast::IDENTIFIER]               = &Semantic::DefiniteSimpleName;
  592.         DefiniteExpr[Ast::DOT]                      = &Semantic::DefiniteFieldAccess;
  593.         DefiniteExpr[Ast::ARRAY_ACCESS]             = &Semantic::DefiniteArrayAccess;
  594.         DefiniteExpr[Ast::CALL]                     = &Semantic::DefiniteMethodInvocation;
  595.         DefiniteExpr[Ast::PARENTHESIZED_EXPRESSION] = &Semantic::DefiniteParenthesizedExpression;
  596.         DefiniteExpr[Ast::CLASS_CREATION]           = &Semantic::DefiniteClassInstanceCreationExpression;
  597.         DefiniteExpr[Ast::ARRAY_CREATION]           = &Semantic::DefiniteArrayCreationExpression;
  598.         DefiniteExpr[Ast::POST_UNARY]               = &Semantic::DefinitePostUnaryExpression;
  599.         DefiniteExpr[Ast::PRE_UNARY]                = &Semantic::DefinitePreUnaryExpression;
  600.         DefiniteExpr[Ast::CAST]                     = &Semantic::DefiniteCastExpression;
  601.         DefiniteExpr[Ast::CHECK_AND_CAST]           = &Semantic::DefiniteCastExpression;
  602.         DefiniteExpr[Ast::BINARY]                   = &Semantic::DefiniteBinaryExpression;
  603.         DefiniteExpr[Ast::CONDITIONAL]              = &Semantic::DefiniteConditionalExpression;
  604.         DefiniteExpr[Ast::ASSIGNMENT]               = &Semantic::DefiniteAssignmentExpression;
  605.  
  606.         DefiniteExpr[Ast::INTEGER_LITERAL]          = &Semantic::DefiniteDefaultExpression;
  607.         DefiniteExpr[Ast::LONG_LITERAL]             = &Semantic::DefiniteDefaultExpression;
  608.         DefiniteExpr[Ast::FLOATING_POINT_LITERAL]   = &Semantic::DefiniteDefaultExpression;
  609.         DefiniteExpr[Ast::DOUBLE_LITERAL]           = &Semantic::DefiniteDefaultExpression;
  610.         DefiniteExpr[Ast::TRUE_LITERAL]             = &Semantic::DefiniteDefaultExpression;
  611.         DefiniteExpr[Ast::FALSE_LITERAL]            = &Semantic::DefiniteDefaultExpression;
  612.         DefiniteExpr[Ast::STRING_LITERAL]           = &Semantic::DefiniteDefaultExpression;
  613.         DefiniteExpr[Ast::CHARACTER_LITERAL]        = &Semantic::DefiniteDefaultExpression;
  614.         DefiniteExpr[Ast::NULL_LITERAL]             = &Semantic::DefiniteDefaultExpression;
  615.         DefiniteExpr[Ast::THIS_EXPRESSION]          = &Semantic::DefiniteDefaultExpression;
  616.         DefiniteExpr[Ast::SUPER_EXPRESSION]         = &Semantic::DefiniteDefaultExpression;
  617.         DefiniteExpr[Ast::TYPE]                     = &Semantic::DefiniteDefaultExpression;
  618.  
  619.         DefiniteBinaryExpr[AstBinaryExpression::PLUS]                 = &Semantic::DefiniteDefaultBinaryExpression;
  620.         DefiniteBinaryExpr[AstBinaryExpression::LEFT_SHIFT]           = &Semantic::DefiniteDefaultBinaryExpression;
  621.         DefiniteBinaryExpr[AstBinaryExpression::RIGHT_SHIFT]          = &Semantic::DefiniteDefaultBinaryExpression;
  622.         DefiniteBinaryExpr[AstBinaryExpression::UNSIGNED_RIGHT_SHIFT] = &Semantic::DefiniteDefaultBinaryExpression;
  623.         DefiniteBinaryExpr[AstBinaryExpression::LESS]                 = &Semantic::DefiniteDefaultBinaryExpression;
  624.         DefiniteBinaryExpr[AstBinaryExpression::GREATER]              = &Semantic::DefiniteDefaultBinaryExpression;
  625.         DefiniteBinaryExpr[AstBinaryExpression::LESS_EQUAL]           = &Semantic::DefiniteDefaultBinaryExpression;
  626.         DefiniteBinaryExpr[AstBinaryExpression::GREATER_EQUAL]        = &Semantic::DefiniteDefaultBinaryExpression;
  627.  
  628.         //
  629.         // TODO: Remove this comment as well as the functions:
  630.         //
  631.         //     DefiniteAND
  632.         //     DefiniteXOR
  633.         //     DefiniteIOR
  634.         //
  635.         //     DefiniteEQUAL
  636.         //     DefiniteNOT_EQUAL
  637.         //
  638.         // when revised spec is released !!!
  639.         //
  640.         //****************************************************************************************
  641.         //
  642.         // To: Martin Odersky <Martin.Odersky@epfl.ch>
  643.         // cc: David Shields/Watson/IBM@IBMUS, compiler@eng.sun.com,
  644.         // gilad.bracha@eng.sun.com, jrose@eng.sun.com,
  645.         // innerclass-comments@lukasiewicz.eng.sun.com, guy.steele@east.sun.com,
  646.         // peter.kessler@eng.sun.com
  647.         // Subject: Re: Query #32 to Sun: Verification problem
  648.         //
  649.         //
  650.         //
  651.         //
  652.         // On Thu, 29 Jul 1999, Martin Odersky wrote:
  653.         //
  654.         // > It seems a very undesirable state of affairs if the Java spec for |,
  655.         // > &, ^ and the JVM spec for iand, ior, ixor differ in their definite
  656.         // > assignment properties. Assuming that it's unreasonable to make the
  657.         // > verifier implement the current JLS spec one-to-one, would it be
  658.         // > possible to tighten the JLS so that definite assignment for |, & ,^ is
  659.         // > done in the way the verifier does it? I doubt that such a tightening
  660.         // > would invalidate any real Java programs.
  661.         //
  662.         // Gilad and I decided today that ammending the JLS was the best course of
  663.         // action, and then discovered that Guy had already done so in our working
  664.         // draft of the revised specification.  We anticipate that when a draft is
  665.         // made
  666.         // available for public review, it will drop sections 16.1.6, 16.1.7, and
  667.         // 16.1.8, which specify special-case rules for the &, |, and ^ operators.
  668.         // They will be covered instead by the general case for expressions with
  669.         // subexpressions, which reads as follows in the current working draft:
  670.         //
  671.         //  If the expression has subexpressions, V is [un]assigned
  672.         //  after the expression iff V is [un]assigned after its rightmost
  673.         //  immediate subexpression.
  674.         //
  675.         // Note that the when-true and when-false cases, currently distinguished
  676.         // for these operators, are now coalesced, as in the general case.
  677.         //
  678.         // Pending an official change to the specification, we recommend that
  679.         // compiler implementors follow the proposed ammendments.
  680.         //
  681.         // Due to the fact that 'javac' has never been in compliance with the
  682.         // current JLS on this issue, nor will much (all?) code that
  683.         // relies on the difference actually verify and execute, compatibility
  684.         // implications should be minimal.
  685.         //
  686.         // --Bill
  687.         //
  688.         //------------------------------------------------------------------------------------------------
  689.         //
  690.         // To: David Shields/Watson/IBM@IBMUS
  691.         // cc: Martin Odersky <Martin.Odersky@epfl.ch>, compiler@eng.sun.com, gilad.bracha@eng.sun.com,
  692.         // jrose@eng.sun.com, innerclass-comments@lukasiewicz.eng.sun.com, guy.steele@east.sun.com,
  693.         // peter.kessler@eng.sun.com
  694.         // Subject: Re: Query #32 to Sun: Verification problem
  695.         //
  696.         // On Mon, 2 Aug 1999 shieldsd@us.ibm.com wrote:
  697.         //
  698.         // > Do you still plan to retain 16.1.3, 16.1.4 and 16.1.11? Since we follow them as
  699.         // > currently written, we accept some of the positive 1.2 JCK tests that javac
  700.         // > currently rejects, but the resulting class files fail verification. Examples
  701.         // > include dasg02901, dasg03001, dasg03301, dasg03303, dasg03401, dasg03501,
  702.         // > dasg04501, dasg04601, dasg04701 and dasg05001).
  703.         // >
  704.         // > dave and philippe
  705.         //
  706.         // We plan to keep these.  However, the special rules for '==' (16.1.9) and
  707.         // '!=' (16.1.10) have also been dropped, again because the bytecodes for these
  708.         // operators create materialized boolean values on the stack at runtime.
  709.         //
  710.         // Guy and Gilad:  In my copy of the draft, the second-to-last sentence on
  711.         // page p.395 claims otherwise, but sections 16.1.9 and 16.1.10 have in fact
  712.         // been deleted.
  713.         //
  714.         // --Bill
  715.         //
  716.         DefiniteBinaryExpr[AstBinaryExpression::AND]                  = &Semantic::DefiniteDefaultBinaryExpression;// &Semantic::DefiniteAND;
  717.         DefiniteBinaryExpr[AstBinaryExpression::XOR]                  = &Semantic::DefiniteDefaultBinaryExpression;// &Semantic::DefiniteXOR;
  718.         DefiniteBinaryExpr[AstBinaryExpression::IOR]                  = &Semantic::DefiniteDefaultBinaryExpression;// &Semantic::DefiniteIOR;
  719.  
  720.         DefiniteBinaryExpr[AstBinaryExpression::EQUAL_EQUAL]          = &Semantic::DefiniteDefaultBinaryExpression; // &Semantic::DefiniteEQUAL_EQUAL;
  721.         DefiniteBinaryExpr[AstBinaryExpression::NOT_EQUAL]            = &Semantic::DefiniteDefaultBinaryExpression; // &Semantic::DefiniteNOT_EQUAL;
  722.  
  723.         DefiniteBinaryExpr[AstBinaryExpression::AND_AND]              = &Semantic::DefiniteAND_AND;
  724.         DefiniteBinaryExpr[AstBinaryExpression::OR_OR]                = &Semantic::DefiniteOR_OR;
  725.         DefiniteBinaryExpr[AstBinaryExpression::STAR]                 = &Semantic::DefiniteDefaultBinaryExpression;
  726.         DefiniteBinaryExpr[AstBinaryExpression::MINUS]                = &Semantic::DefiniteDefaultBinaryExpression;
  727.         DefiniteBinaryExpr[AstBinaryExpression::SLASH]                = &Semantic::DefiniteDefaultBinaryExpression;
  728.         DefiniteBinaryExpr[AstBinaryExpression::MOD]                  = &Semantic::DefiniteDefaultBinaryExpression;
  729.         DefiniteBinaryExpr[AstBinaryExpression::INSTANCEOF]           = &Semantic::DefiniteDefaultBinaryExpression;
  730.  
  731.         DefinitePreUnaryExpr[AstPreUnaryExpression::PLUS]             = &Semantic::DefiniteDefaultPreUnaryExpression;
  732.         DefinitePreUnaryExpr[AstPreUnaryExpression::MINUS]            = &Semantic::DefiniteDefaultPreUnaryExpression;
  733.         DefinitePreUnaryExpr[AstPreUnaryExpression::TWIDDLE]          = &Semantic::DefiniteDefaultPreUnaryExpression;
  734.         DefinitePreUnaryExpr[AstPreUnaryExpression::NOT]              = &Semantic::DefiniteNOT;
  735.         DefinitePreUnaryExpr[AstPreUnaryExpression::PLUSPLUS]         = &Semantic::DefinitePLUSPLUSOrMINUSMINUS;
  736.         DefinitePreUnaryExpr[AstPreUnaryExpression::MINUSMINUS]       = &Semantic::DefinitePLUSPLUSOrMINUSMINUS;
  737.  
  738.         ProcessBinaryExpr[AstBinaryExpression::PLUS]                 = &Semantic::ProcessPLUS;
  739.         ProcessBinaryExpr[AstBinaryExpression::LEFT_SHIFT]           = &Semantic::ProcessLEFT_SHIFT;
  740.         ProcessBinaryExpr[AstBinaryExpression::RIGHT_SHIFT]          = &Semantic::ProcessRIGHT_SHIFT;
  741.         ProcessBinaryExpr[AstBinaryExpression::UNSIGNED_RIGHT_SHIFT] = &Semantic::ProcessUNSIGNED_RIGHT_SHIFT;
  742.         ProcessBinaryExpr[AstBinaryExpression::LESS]                 = &Semantic::ProcessLESS;
  743.         ProcessBinaryExpr[AstBinaryExpression::GREATER]              = &Semantic::ProcessGREATER;
  744.         ProcessBinaryExpr[AstBinaryExpression::LESS_EQUAL]           = &Semantic::ProcessLESS_EQUAL;
  745.         ProcessBinaryExpr[AstBinaryExpression::GREATER_EQUAL]        = &Semantic::ProcessGREATER_EQUAL;
  746.         ProcessBinaryExpr[AstBinaryExpression::AND]                  = &Semantic::ProcessAND;
  747.         ProcessBinaryExpr[AstBinaryExpression::XOR]                  = &Semantic::ProcessXOR;
  748.         ProcessBinaryExpr[AstBinaryExpression::IOR]                  = &Semantic::ProcessIOR;
  749.         ProcessBinaryExpr[AstBinaryExpression::AND_AND]              = &Semantic::ProcessAND_AND;
  750.         ProcessBinaryExpr[AstBinaryExpression::OR_OR]                = &Semantic::ProcessOR_OR;
  751.         ProcessBinaryExpr[AstBinaryExpression::EQUAL_EQUAL]          = &Semantic::ProcessEQUAL_EQUAL;
  752.         ProcessBinaryExpr[AstBinaryExpression::NOT_EQUAL]            = &Semantic::ProcessNOT_EQUAL;
  753.         ProcessBinaryExpr[AstBinaryExpression::STAR]                 = &Semantic::ProcessSTAR;
  754.         ProcessBinaryExpr[AstBinaryExpression::MINUS]                = &Semantic::ProcessMINUS;
  755.         ProcessBinaryExpr[AstBinaryExpression::SLASH]                = &Semantic::ProcessSLASH;
  756.         ProcessBinaryExpr[AstBinaryExpression::MOD]                  = &Semantic::ProcessMOD;
  757.         ProcessBinaryExpr[AstBinaryExpression::INSTANCEOF]           = &Semantic::ProcessINSTANCEOF;
  758.  
  759.         ProcessPreUnaryExpr[AstPreUnaryExpression::PLUS]       = &Semantic::ProcessPLUS;
  760.         ProcessPreUnaryExpr[AstPreUnaryExpression::MINUS]      = &Semantic::ProcessMINUS;
  761.         ProcessPreUnaryExpr[AstPreUnaryExpression::TWIDDLE]    = &Semantic::ProcessTWIDDLE;
  762.         ProcessPreUnaryExpr[AstPreUnaryExpression::NOT]        = &Semantic::ProcessNOT;
  763.         ProcessPreUnaryExpr[AstPreUnaryExpression::PLUSPLUS]   = &Semantic::ProcessPLUSPLUSOrMINUSMINUS;
  764.         ProcessPreUnaryExpr[AstPreUnaryExpression::MINUSMINUS] = &Semantic::ProcessPLUSPLUSOrMINUSMINUS;
  765.     }
  766.  
  767.     ~Semantic() { delete error; }
  768.  
  769.     void ReportSemError(SemanticError::SemanticErrorKind kind,
  770.                         LexStream::TokenIndex ltok,
  771.                         LexStream::TokenIndex rtok,
  772.                         wchar_t *s1 = NULL,
  773.                         wchar_t *s2 = NULL,
  774.                         wchar_t *s3 = NULL,
  775.                         wchar_t *s4 = NULL,
  776.                         wchar_t *s5 = NULL,
  777.                         wchar_t *s6 = NULL,
  778.                         wchar_t *s7 = NULL,
  779.                         wchar_t *s8 = NULL,
  780.                         wchar_t *s9 = NULL)
  781.     {
  782.         if (! error)
  783.             error = new SemanticError(control, source_file_symbol);
  784.         error -> Report(kind, ltok, rtok, s1, s2, s3, s4, s5, s6, s7, s8, s9);
  785.     }
  786.  
  787.     int NumErrors() { return (error ? error -> num_errors : 0); }
  788.  
  789.     //
  790.     // If we had a bad compilation unit, print the parser messages.
  791.     // If semantic errors were detected print them too.
  792.     // Set the return code.
  793.     //
  794.     void PrintMessages()
  795.     {
  796.         if (this != control.system_semantic)
  797.         {
  798.             if (lex_stream -> NumBadTokens() > 0)
  799.             {
  800.                 lex_stream -> PrintMessages();
  801.                 return_code = 1;
  802.             }
  803.  
  804.             if ((! compilation_unit) || compilation_unit -> BadCompilationUnitCast())
  805.             {
  806.                 DiagnoseParser *diagnose_parser = new DiagnoseParser(control, lex_stream);
  807.                 return_code = 1;
  808.                 delete diagnose_parser;
  809.             }
  810.  
  811.             if (compilation_unit)
  812.                 CleanUp();
  813.         }
  814.  
  815.         if (error && error -> error.Length() > 0 && error -> PrintMessages() > return_code)
  816.             return_code = 1;
  817.  
  818.         //
  819.         // Once we have processed the errors, reset the error object
  820.         //
  821.         delete error;
  822.         error = NULL;
  823.  
  824.         return;
  825.     }
  826.  
  827.     TypeSymbol *ProcessSignature(TypeSymbol *, char *, LexStream::TokenIndex);
  828.     TypeSymbol *ReadType(FileSymbol *, PackageSymbol *, NameSymbol *, LexStream::TokenIndex);
  829.     TypeSymbol *ReadTypeFromSignature(TypeSymbol *, char *, int, LexStream::TokenIndex);
  830.     TypeSymbol *ProcessNestedType(TypeSymbol *, NameSymbol *, LexStream::TokenIndex);
  831.  
  832. private:
  833.  
  834.     SemanticError *error;
  835.  
  836.     void CleanUp();
  837.     void CleanUpType(TypeSymbol *);
  838.  
  839.     void SetDefaultSuperType(AstClassDeclaration *);
  840.     void SetDefaultSuperType(AstInterfaceDeclaration *);
  841.     void ProcessTypeHeader(AstClassDeclaration *);
  842.     void MarkCircularNest(TypeSymbol *);
  843.     void ProcessSuperTypesOfOuterType(TypeSymbol *);
  844.     void ProcessSuperTypesOfInnerType(TypeSymbol *, Tuple<TypeSymbol *> &);
  845.     void ProcessTypeHeaders(AstClassDeclaration *);
  846.     TypeSymbol *FindTypeInLayer(Ast *, SymbolSet &);
  847.     void ProcessNestedSuperTypes(TypeSymbol *);
  848.     void ProcessNestedTypeHeaders(TypeSymbol *, AstClassBody *);
  849.     void ProcessTypeHeader(AstInterfaceDeclaration *);
  850.     void ProcessTypeHeaders(AstInterfaceDeclaration *);
  851.     void ProcessNestedTypeHeaders(AstInterfaceDeclaration *);
  852.     void ProcessConstructorMembers(AstClassBody *);
  853.     void ProcessMethodMembers(AstClassBody *);
  854.     void ProcessFieldMembers(AstClassBody *);
  855.     void ProcessMembers(SemanticEnvironment *, AstClassBody *);
  856.     void CompleteSymbolTable(SemanticEnvironment *, LexStream::TokenIndex, AstClassBody *);
  857.     void ProcessExecutableBodies(SemanticEnvironment *, AstClassBody *);
  858.     void ProcessExecutableBodies(AstInterfaceDeclaration *);
  859.  
  860.     void ProcessMethodMembers(AstInterfaceDeclaration *);
  861.     void ProcessFieldMembers(AstInterfaceDeclaration *);
  862.     void ProcessMembers(AstInterfaceDeclaration *);
  863.     void CompleteSymbolTable(AstInterfaceDeclaration *);
  864.  
  865.     friend class TypeSymbol;
  866.  
  867.     Tuple<Symbol *> import_on_demand_packages;
  868.     Tuple<TypeSymbol *> single_type_imports;
  869.  
  870.     //
  871.     // Where am I?
  872.     //
  873.     PackageSymbol  *this_package;
  874.  
  875.     TypeSymbol *ThisType()                        { assert(state_stack.Size()); return state_stack.Top() -> Type(); }
  876.     MethodSymbol *&ThisMethod()                   { assert(state_stack.Size()); return state_stack.Top() -> this_method; }
  877.     VariableSymbol *&ThisVariable()               { assert(state_stack.Size()); return state_stack.Top() -> this_variable; }
  878.     Ast *&ExplicitConstructorInvocation()         { assert(state_stack.Size()); return state_stack.Top() -> explicit_constructor_invocation; }
  879.     SymbolTableStack &LocalSymbolTable()          { assert(state_stack.Size()); return state_stack.Top() -> symbol_table; }
  880.     ExceptionTableStack &TryExceptionTableStack() { assert(state_stack.Size()); return state_stack.Top() -> try_exception_table_stack; }
  881.     StatementStack &TryStatementStack()           { assert(state_stack.Size()); return state_stack.Top() -> try_statement_stack; }
  882.     StatementStack &BreakableStatementStack()     { assert(state_stack.Size()); return state_stack.Top() -> breakable_statement_stack; }
  883.     StatementStack &ContinuableStatementStack()   { assert(state_stack.Size()); return state_stack.Top() -> continuable_statement_stack; }
  884.     BlockStack &LocalBlockStack()                 { assert(state_stack.Size()); return state_stack.Top() -> block_stack; }
  885.     SemanticEnvironment *GetEnvironment(Ast *ast) { assert(state_stack.Size()); return state_stack.Top() -> GetEnvironment(ast); }
  886.     bool StaticRegion()                           { assert(state_stack.Size()); return state_stack.Top() -> StaticRegion(); }
  887.  
  888.     SemanticEnvironmentStack state_stack;
  889.  
  890.     BitSet *definitely_assigned_variables,
  891.            *possibly_assigned_finals,
  892.            *universe;
  893.     DefiniteBlockStack *definite_block_stack;
  894.     DefiniteTryStack *definite_try_stack;
  895.     DefiniteFinalAssignmentStack *definite_final_assignment_stack;
  896.     SymbolSet *definite_visible_variables;
  897.  
  898.     bool IsIntValueRepresentableInType(AstExpression *, TypeSymbol *);
  899.  
  900.     void CheckClassMembers(TypeSymbol *, AstClassBody *);
  901.     void CheckNestedTypeDuplication(SemanticEnvironment *, LexStream::TokenIndex);
  902.     TypeSymbol *ProcessNestedClassName(TypeSymbol *, AstClassDeclaration *);
  903.     void CheckInterfaceMembers(TypeSymbol *, AstInterfaceDeclaration *);
  904.     TypeSymbol *ProcessNestedInterfaceName(TypeSymbol *, AstInterfaceDeclaration *);
  905.     TypeSymbol *FindTypeInShadow(TypeShadowSymbol *, LexStream::TokenIndex);
  906.     void ReportTypeInaccessible(LexStream::TokenIndex, LexStream::TokenIndex, TypeSymbol *);
  907.     void ReportTypeInaccessible(Ast *ast, TypeSymbol *type) { ReportTypeInaccessible(ast -> LeftToken(), ast -> RightToken(), type); }
  908.     TypeSymbol *GetBadNestedType(TypeSymbol *, LexStream::TokenIndex);
  909.     TypeSymbol *FindNestedType(TypeSymbol *, LexStream::TokenIndex);
  910.     TypeSymbol *MustFindNestedType(TypeSymbol *, Ast *);
  911.     void ProcessImportQualifiedName(AstExpression *);
  912.     void ProcessPackageOrType(AstExpression *);
  913.     void ProcessTypeImportOnDemandDeclaration(AstImportDeclaration *);
  914.     AstExpression *FindFirstType(Ast *);
  915.     TypeSymbol *FindSimpleNameType(PackageSymbol *, LexStream::TokenIndex);
  916.     void ProcessSingleTypeImportDeclaration(AstImportDeclaration *);
  917.     AccessFlags ProcessClassModifiers(AstClassDeclaration *);
  918.     AccessFlags ProcessLocalClassModifiers(AstClassDeclaration *);
  919.     AccessFlags ProcessNestedClassModifiers(AstClassDeclaration *);
  920.     AccessFlags ProcessStaticNestedClassModifiers(AstClassDeclaration *);
  921.     AccessFlags ProcessInterfaceModifiers(AstInterfaceDeclaration *);
  922.     AccessFlags ProcessNestedInterfaceModifiers(AstInterfaceDeclaration *);
  923.     AccessFlags ProcessFieldModifiers(AstFieldDeclaration *);
  924.     AccessFlags ProcessLocalModifiers(AstLocalVariableDeclarationStatement *);
  925.     AccessFlags ProcessFormalModifiers(AstFormalParameter *);
  926.     AccessFlags ProcessMethodModifiers(AstMethodDeclaration *);
  927.     AccessFlags ProcessConstructorModifiers(AstConstructorDeclaration *);
  928.     AccessFlags ProcessConstantModifiers(AstFieldDeclaration *);
  929.     AccessFlags ProcessAbstractMethodModifiers(AstMethodDeclaration *);
  930.     void AddDefaultConstructor(TypeSymbol *);
  931.     void ProcessConstructorDeclaration(AstConstructorDeclaration *);
  932.     void ProcessMethodDeclaration(AstMethodDeclaration *);
  933.     void ProcessFieldDeclaration(AstFieldDeclaration *);
  934.     void ProcessFormalParameters(BlockSymbol *, AstMethodDeclarator *);
  935.     TypeSymbol *ImportType(LexStream::TokenIndex, NameSymbol *);
  936.     TypeSymbol *FindPrimitiveType(AstPrimitiveType *);
  937.     TypeSymbol *FindTypeInEnvironment(SemanticEnvironment *, NameSymbol *);
  938.     TypeSymbol *FindType(LexStream::TokenIndex);
  939.     TypeSymbol *MustFindType(Ast *);
  940.     void ProcessInterface(TypeSymbol *, AstExpression *);
  941.  
  942.     void InitializeVariable(AstFieldDeclaration *, Tuple<VariableSymbol *> &);
  943.     void ProcessInitializer(AstBlock *, AstBlock *, MethodSymbol *, Tuple<VariableSymbol *> &);
  944.     bool NeedsInitializationMethod(AstFieldDeclaration *);
  945.     void ProcessStaticInitializers(AstClassBody *);
  946.     void ProcessBlockInitializers(AstClassBody *);
  947.  
  948.     bool CanWideningPrimitiveConvert(TypeSymbol *, TypeSymbol *);
  949.     bool CanNarrowingPrimitiveConvert(TypeSymbol *, TypeSymbol *);
  950.     bool CanCastConvert(TypeSymbol *, TypeSymbol *, LexStream::TokenIndex);
  951.     bool CanMethodInvocationConvert(TypeSymbol *, TypeSymbol *);
  952.     bool CanAssignmentConvert(TypeSymbol *, AstExpression *);
  953.     bool CanAssignmentConvertReference(TypeSymbol *, TypeSymbol *);
  954.     LiteralValue *CastPrimitiveValue(TypeSymbol *, AstExpression *);
  955.     LiteralValue *CastValue(TypeSymbol *, AstExpression *);
  956.     AstExpression *ConvertToType(AstExpression *, TypeSymbol *);
  957.     AstExpression *PromoteUnaryNumericExpression(AstExpression *);
  958.     void BinaryNumericPromotion(AstAssignmentExpression *);
  959.     void BinaryNumericPromotion(AstBinaryExpression *);
  960.     void BinaryNumericPromotion(AstConditionalExpression *);
  961.  
  962.     void (Semantic::*DefiniteStmt[Ast::_num_kinds])(Ast *);
  963.     inline void DefiniteStatement(Ast *ast)
  964.     {
  965.         (this ->* DefiniteStmt[ast -> kind])(ast);
  966.     }
  967.  
  968.     void DefiniteLoopBody(AstStatement *);
  969.  
  970.     void DefiniteBlock(Ast *);
  971.     void DefiniteLocalVariableDeclarationStatement(Ast *);
  972.     void DefiniteExpressionStatement(Ast *);
  973.     void DefiniteSynchronizedStatement(Ast *);
  974.     void DefiniteIfStatement(Ast *);
  975.     void DefiniteWhileStatement(Ast *);
  976.     void DefiniteForStatement(Ast *);
  977.     void DefiniteSwitchStatement(Ast *);
  978.     void DefiniteDoStatement(Ast *);
  979.     void DefiniteBreakStatement(Ast *);
  980.     void DefiniteContinueStatement(Ast *);
  981.     void DefiniteReturnStatement(Ast *);
  982.     void DefiniteThrowStatement(Ast *);
  983.     void DefiniteTryStatement(Ast *);
  984.     void DefiniteEmptyStatement(Ast *);
  985.     void DefiniteClassDeclaration(Ast *);
  986.  
  987.     VariableSymbol *DefiniteFinal(AstFieldAccess *);
  988.  
  989.     DefiniteAssignmentSet *(Semantic::*DefiniteExpr[Ast::_num_expression_kinds])(AstExpression *, BitSet &);
  990.     DefiniteAssignmentSet *DefiniteSimpleName(AstExpression *, BitSet &);
  991.     DefiniteAssignmentSet *DefiniteArrayAccess(AstExpression *, BitSet &);
  992.     DefiniteAssignmentSet *DefiniteMethodInvocation(AstExpression *, BitSet &);
  993.     DefiniteAssignmentSet *DefiniteClassInstanceCreationExpression(AstExpression *, BitSet &);
  994.     DefiniteAssignmentSet *DefiniteArrayCreationExpression(AstExpression *, BitSet &);
  995.     DefiniteAssignmentSet *DefinitePreUnaryExpression(AstExpression *, BitSet &);
  996.     DefiniteAssignmentSet *DefinitePostUnaryExpression(AstExpression *, BitSet &);
  997.     DefiniteAssignmentSet *DefiniteBinaryExpression(AstExpression *, BitSet &);
  998.     DefiniteAssignmentSet *DefiniteConditionalExpression(AstExpression *, BitSet &);
  999.     DefiniteAssignmentSet *DefiniteAssignmentExpression(AstExpression *, BitSet &);
  1000.     DefiniteAssignmentSet *DefiniteDefaultExpression(AstExpression *, BitSet &);
  1001.     DefiniteAssignmentSet *DefiniteFieldAccess(AstExpression *, BitSet &);
  1002.     DefiniteAssignmentSet *DefiniteParenthesizedExpression(AstExpression *, BitSet &);
  1003.     DefiniteAssignmentSet *DefiniteCastExpression(AstExpression *, BitSet &);
  1004.     DefiniteAssignmentSet *DefiniteExpression(AstExpression *, BitSet &);
  1005.  
  1006.     DefiniteAssignmentSet *(Semantic::*DefinitePreUnaryExpr[AstPreUnaryExpression::_num_kinds])(AstExpression *, BitSet &);
  1007.     DefiniteAssignmentSet *DefiniteDefaultPreUnaryExpression(AstExpression *, BitSet &);
  1008.     DefiniteAssignmentSet *DefiniteNOT(AstExpression *, BitSet &);
  1009.     DefiniteAssignmentSet *DefinitePLUSPLUSOrMINUSMINUS(AstExpression *, BitSet &);
  1010.  
  1011.     DefiniteAssignmentSet *(Semantic::*DefiniteBinaryExpr[AstBinaryExpression::_num_kinds])(AstBinaryExpression *, BitSet &);
  1012.     DefiniteAssignmentSet *DefiniteDefaultBinaryExpression(AstBinaryExpression *, BitSet &);
  1013.     DefiniteAssignmentSet *DefiniteAND(AstBinaryExpression *, BitSet &);
  1014.     DefiniteAssignmentSet *DefiniteIOR(AstBinaryExpression *, BitSet &);
  1015.     DefiniteAssignmentSet *DefiniteXOR(AstBinaryExpression *, BitSet &);
  1016.     DefiniteAssignmentSet *DefiniteAND_AND(AstBinaryExpression *, BitSet &);
  1017.     DefiniteAssignmentSet *DefiniteOR_OR(AstBinaryExpression *, BitSet &);
  1018.     DefiniteAssignmentSet *DefiniteEQUAL_EQUAL(AstBinaryExpression *, BitSet &);
  1019.     DefiniteAssignmentSet *DefiniteNOT_EQUAL(AstBinaryExpression *, BitSet &);
  1020.  
  1021.     DefiniteAssignmentSet *DefiniteAssignmentAND(TypeSymbol *, BitSet *, BitSet &, DefiniteAssignmentSet *, DefiniteAssignmentSet *);
  1022.     DefiniteAssignmentSet *DefiniteAssignmentIOR(TypeSymbol *, BitSet *, BitSet &, DefiniteAssignmentSet *, DefiniteAssignmentSet *);
  1023.     DefiniteAssignmentSet *DefiniteAssignmentXOR(TypeSymbol *, BitSet *, BitSet &, DefiniteAssignmentSet *, DefiniteAssignmentSet *);
  1024.  
  1025.     void DefiniteArrayInitializer(AstArrayInitializer *);
  1026.     void DefiniteVariableInitializer(AstVariableDeclarator *);
  1027.     void DefiniteBlockStatements(AstBlock *);
  1028.     void DefiniteMethodBody(AstMethodDeclaration *, Tuple<VariableSymbol *> &);
  1029.     void DefiniteConstructorBody(AstConstructorDeclaration *, Tuple<VariableSymbol *> &);
  1030.     void DefiniteBlockInitializer(AstBlock *, int, Tuple<VariableSymbol *> &);
  1031.     void DefiniteVariableInitializer(AstVariableDeclarator *, Tuple<VariableSymbol *> &);
  1032.  
  1033.     void ProcessBlockStatements(AstBlock *);
  1034.     void ProcessThisCall(AstThisCall *);
  1035.     void ProcessSuperCall(AstSuperCall *);
  1036.     void CheckThrow(AstExpression *);
  1037.     void ProcessMethodBody(AstMethodDeclaration *);
  1038.     void ProcessConstructorBody(AstConstructorDeclaration *, bool);
  1039.     bool CatchableException(TypeSymbol *);
  1040.     void ReportMethodNotFound(Ast *ast, wchar_t *);
  1041.     MethodSymbol *FindConstructor(TypeSymbol *, Ast *, LexStream::TokenIndex, LexStream::TokenIndex);
  1042.     bool MoreSpecific(MethodSymbol *, MethodSymbol *);
  1043.     bool MoreSpecific(MethodSymbol *, Tuple<MethodSymbol *> &);
  1044.     bool NoMethodMoreSpecific(Tuple<MethodSymbol *> &, MethodSymbol *);
  1045.     bool IsMethodAccessible(AstFieldAccess *, TypeSymbol *, MethodSymbol *);
  1046.     void SearchForMethodInEnvironment(Tuple<MethodSymbol *> &, SemanticEnvironment *&, SemanticEnvironment *, AstMethodInvocation *);
  1047.     MethodSymbol *FindMisspelledMethodName(TypeSymbol *, AstMethodInvocation *, NameSymbol *);
  1048.     MethodSymbol *FindMethodInEnvironment(SemanticEnvironment *&, SemanticEnvironment *, AstMethodInvocation *);
  1049.     MethodSymbol *FindMethodInType(TypeSymbol *, AstMethodInvocation *, NameSymbol * = NULL);
  1050.  
  1051.     void ReportAccessedFieldNotFound(AstFieldAccess *, TypeSymbol *);
  1052.     void SearchForVariableInEnvironment(Tuple<VariableSymbol *> &, SemanticEnvironment *&,
  1053.                                         SemanticEnvironment *, NameSymbol *, LexStream::TokenIndex);
  1054.     VariableSymbol *FindMisspelledVariableName(TypeSymbol *, LexStream::TokenIndex);
  1055.     VariableSymbol *FindVariableInEnvironment(SemanticEnvironment *&, SemanticEnvironment *, LexStream::TokenIndex);
  1056.     VariableSymbol *FindVariableInType(TypeSymbol *, AstFieldAccess *, NameSymbol * = NULL);
  1057.     VariableSymbol *FindInstance(TypeSymbol *, TypeSymbol *);
  1058.     AstExpression *CreateAccessToType(Ast *, TypeSymbol *);
  1059.     void CreateAccessToScopedVariable(AstSimpleName *, TypeSymbol *);
  1060.     void CreateAccessToScopedMethod(AstMethodInvocation *, TypeSymbol *);
  1061.  
  1062.     void TypeAccessCheck(Ast *, TypeSymbol *);
  1063.     void TypeNestAccessCheck(AstExpression *);
  1064.     void ConstructorAccessCheck(AstClassInstanceCreationExpression *, MethodSymbol *);
  1065.     void MemberAccessCheck(AstFieldAccess *, TypeSymbol *, Symbol *);
  1066.     void SimpleNameAccessCheck(AstSimpleName *, TypeSymbol *, Symbol *);
  1067.  
  1068.     void (Semantic::*ProcessPreUnaryExpr[AstPreUnaryExpression::_num_kinds])(AstPreUnaryExpression *);
  1069.     void ProcessPLUS(AstPreUnaryExpression *);
  1070.     void ProcessMINUS(AstPreUnaryExpression *);
  1071.     void ProcessTWIDDLE(AstPreUnaryExpression *);
  1072.     void ProcessNOT(AstPreUnaryExpression *);
  1073.     void ProcessPLUSPLUSOrMINUSMINUS(AstPreUnaryExpression *);
  1074.  
  1075.     void (Semantic::*ProcessBinaryExpr[AstBinaryExpression::_num_kinds])(AstBinaryExpression *);
  1076.     void ProcessPLUS(AstBinaryExpression *);
  1077.     void ProcessLEFT_SHIFT(AstBinaryExpression *);
  1078.     void ProcessRIGHT_SHIFT(AstBinaryExpression *);
  1079.     void ProcessUNSIGNED_RIGHT_SHIFT(AstBinaryExpression *);
  1080.     void ProcessLESS(AstBinaryExpression *);
  1081.     void ProcessGREATER(AstBinaryExpression *);
  1082.     void ProcessLESS_EQUAL(AstBinaryExpression *);
  1083.     void ProcessGREATER_EQUAL(AstBinaryExpression *);
  1084.     void ProcessAND(AstBinaryExpression *);
  1085.     void ProcessXOR(AstBinaryExpression *);
  1086.     void ProcessIOR(AstBinaryExpression *);
  1087.     void ProcessAND_AND(AstBinaryExpression *);
  1088.     void ProcessOR_OR(AstBinaryExpression *);
  1089.     void ProcessEQUAL_EQUAL(AstBinaryExpression *);
  1090.     void ProcessNOT_EQUAL(AstBinaryExpression *);
  1091.     void ProcessSTAR(AstBinaryExpression *);
  1092.     void ProcessMINUS(AstBinaryExpression *);
  1093.     void ProcessSLASH(AstBinaryExpression *);
  1094.     void ProcessMOD(AstBinaryExpression *);
  1095.     void ProcessINSTANCEOF(AstBinaryExpression *);
  1096.  
  1097.     MethodSymbol *FindMethodMember(TypeSymbol *, TypeSymbol *, AstMethodInvocation *);
  1098.     void ProcessMethodName(AstMethodInvocation *);
  1099.     void (Semantic::*ProcessExprOrStmt[Ast::_num_kinds])(Ast *);
  1100.     inline void ProcessStatement(AstStatement *stmt)
  1101.     {
  1102.         (this ->* ProcessExprOrStmt[stmt -> kind])(stmt);
  1103.     }
  1104.  
  1105.     inline void ProcessExpression(AstExpression *expr)
  1106.     {
  1107.         (this ->* ProcessExprOrStmt[expr -> kind])(expr);
  1108.     }
  1109.  
  1110.     inline void ProcessExpressionOrStringConstant(AstExpression *expr)
  1111.     {
  1112.         (this ->* ProcessExprOrStmt[expr -> kind])(expr);
  1113.         //
  1114.         // If the expression is of type String, check whether or not it is
  1115.         // constant, and if so, compute the result.
  1116.         //
  1117.         if (expr -> symbol == control.String() && (! expr -> IsConstant()))
  1118.             control.Utf8_pool.CheckStringConstant(expr);
  1119.  
  1120.         return;
  1121.     }
  1122.  
  1123.     void ProcessLocalVariableDeclarationStatement(Ast *);
  1124.     void ProcessBlock(Ast *);
  1125.     void ProcessForStatement(Ast *);
  1126.     void ProcessSwitchStatement(Ast *);
  1127.     void ProcessThrowStatement(Ast *);
  1128.     void ProcessTryStatement(Ast *);
  1129.     void ProcessExpressionStatement(Ast *);
  1130.     void ProcessSynchronizedStatement(Ast *);
  1131.     void ProcessIfStatement(Ast *);
  1132.     void ProcessWhileStatement(Ast *);
  1133.     void ProcessDoStatement(Ast *);
  1134.     void ProcessBreakStatement(Ast *);
  1135.     void ProcessContinueStatement(Ast *);
  1136.     void ProcessReturnStatement(Ast *);
  1137.     void ProcessEmptyStatement(Ast *);
  1138.     TypeSymbol *GetLocalType(AstClassDeclaration *);
  1139.     void ProcessClassDeclaration(Ast *);
  1140.     void GenerateLocalConstructor(MethodSymbol *);
  1141.  
  1142.     void CheckSimpleName(AstSimpleName *, SemanticEnvironment *where_found);
  1143.     void ProcessSimpleName(Ast *);
  1144.     void FindVariableMember(TypeSymbol *, TypeSymbol *, AstFieldAccess *);
  1145.     void ProcessAmbiguousName(Ast *);
  1146.     void ProcessFieldAccess(Ast *);
  1147.     void ProcessIntegerLiteral(Ast *);
  1148.     void ProcessLongLiteral(Ast *);
  1149.     void ProcessFloatingPointLiteral(Ast *);
  1150.     void ProcessDoubleLiteral(Ast *);
  1151.     void ProcessTrueLiteral(Ast *);
  1152.     void ProcessFalseLiteral(Ast *);
  1153.     void ProcessStringLiteral(Ast *);
  1154.     void ProcessCharacterLiteral(Ast *);
  1155.     void ProcessArrayAccess(Ast *);
  1156.     void ProcessMethodInvocation(Ast *);
  1157.     void ProcessNullLiteral(Ast *);
  1158.     void ProcessThisExpression(Ast *);
  1159.     void ProcessSuperExpression(Ast *);
  1160.     void ProcessParenthesizedExpression(Ast *);
  1161.     void UpdateGeneratedLocalConstructor(MethodSymbol *);
  1162.     void UpdateLocalConstructors(TypeSymbol *);
  1163.     void GetAnonymousConstructor(AstClassInstanceCreationExpression *, TypeSymbol *);
  1164.     TypeSymbol *GetAnonymousType(AstClassInstanceCreationExpression *, TypeSymbol *);
  1165.     void ProcessClassInstanceCreationExpression(Ast *);
  1166.     void ProcessArrayCreationExpression(Ast *);
  1167.     void ProcessPostUnaryExpression(Ast *);
  1168.     void ProcessPreUnaryExpression(Ast *);
  1169.     void ProcessCastExpression(Ast *);
  1170.     void ProcessBinaryExpression(Ast *);
  1171.     void ProcessTypeExpression(Ast *);
  1172.     void ProcessConditionalExpression(Ast *);
  1173.     void ProcessAssignmentExpression(Ast *);
  1174.  
  1175.     void ProcessVariableInitializer(AstVariableDeclarator *);
  1176.     void ProcessArrayInitializer(AstArrayInitializer *, TypeSymbol *);
  1177.  
  1178.     void CheckInheritedMethodThrows(AstMethodDeclaration *, MethodSymbol *);
  1179.     void CheckMethodOverride(AstMethodDeclaration *, MethodSymbol *);
  1180.     void CheckInheritedMethodThrows(AstClassDeclaration *, MethodSymbol *, MethodSymbol *);
  1181.     void CheckMethodOverride(AstClassDeclaration *, MethodSymbol *, MethodSymbol *);
  1182.     void AddInheritedTypes(TypeSymbol *, TypeSymbol *);
  1183.     void AddInheritedFields(TypeSymbol *, TypeSymbol *);
  1184.     void AddInheritedMethods(TypeSymbol *, TypeSymbol *, LexStream::TokenIndex);
  1185.     void ComputeTypesClosure(TypeSymbol *, LexStream::TokenIndex);
  1186.     void ComputeFieldsClosure(TypeSymbol *, LexStream::TokenIndex);
  1187.     void ComputeMethodsClosure(TypeSymbol *, LexStream::TokenIndex);
  1188.  
  1189.     inline bool InRange(char *buffer_ptr, char *buffer_tail, int size) { return ((buffer_ptr + size) <= buffer_tail); }
  1190.     TypeSymbol *RetrieveNestedTypes(TypeSymbol *, wchar_t *, LexStream::TokenIndex);
  1191.     TypeSymbol *GetClassPool(TypeSymbol *, TypeSymbol **, char **, int, LexStream::TokenIndex);
  1192.     void ProcessBadClass(TypeSymbol *, LexStream::TokenIndex);
  1193.     bool ProcessClassFile(TypeSymbol *, char *, int, LexStream::TokenIndex);
  1194.     void ReadClassFile(TypeSymbol *, LexStream::TokenIndex);
  1195.  
  1196.     //
  1197.     // Any exception that is neither RuntimeException or one of its subclasses nor
  1198.     // Error or one of its subclasses is a checked exception.
  1199.     //
  1200.     inline bool CheckedException(TypeSymbol *exception)
  1201.     {
  1202.         return (! (exception -> IsSubclass(control.RuntimeException()) || exception -> IsSubclass(control.Error())));
  1203.     }
  1204.  
  1205. public:
  1206.  
  1207.     static inline u1 GetU1(char *);
  1208.     static inline u2 GetU2(char *);
  1209.     static inline u4 GetU4(char *);
  1210.  
  1211.     static inline u1 GetAndSkipU1(char *&);
  1212.     static inline u2 GetAndSkipU2(char *&);
  1213.     static inline u4 GetAndSkipU4(char *&);
  1214.     static inline void Skip(char *&, int);
  1215.  
  1216.     inline void AddDependence(TypeSymbol *, TypeSymbol *, LexStream::TokenIndex, bool = false);
  1217.     inline void SetObjectSuperType(TypeSymbol *, LexStream::TokenIndex);
  1218.     inline void AddStringConversionDependence(TypeSymbol *, LexStream::TokenIndex);
  1219. };
  1220.  
  1221.  
  1222. inline void Semantic::AddDependence(TypeSymbol *base_type_, TypeSymbol *parent_type_, LexStream::TokenIndex tok, bool static_access)
  1223. {
  1224.     if (base_type_ != control.no_type)
  1225.     {
  1226.         TypeSymbol *base_type = base_type_ -> outermost_type,
  1227.                    *parent_type = parent_type_ -> outermost_type;
  1228.  
  1229.         parent_type -> dependents -> AddElement(base_type);
  1230.         if (static_access)
  1231.              base_type -> static_parents -> AddElement(parent_type);
  1232.         else base_type -> parents -> AddElement(parent_type);
  1233.  
  1234.         if (control.option.pedantic)
  1235.         {
  1236.             if (parent_type -> ContainingPackage() == control.unnamed_package &&
  1237.                 base_type -> ContainingPackage() != control.unnamed_package)
  1238.             {
  1239.                 error -> Report(SemanticError::PARENT_TYPE_IN_UNNAMED_PACKAGE,
  1240.                                 tok,
  1241.                                 tok,
  1242.                                 parent_type_ -> ContainingPackage() -> PackageName(),
  1243.                                 parent_type_ -> ExternalName());
  1244.             }
  1245.         }
  1246.     }
  1247.  
  1248.     return;
  1249. }
  1250.  
  1251. inline void Semantic::SetObjectSuperType(TypeSymbol *type, LexStream::TokenIndex tok)
  1252. {
  1253.     type -> super = control.Object();
  1254.     AddDependence(type, type -> super, tok);
  1255. }
  1256.  
  1257. inline void Semantic::AddStringConversionDependence(TypeSymbol *type, LexStream::TokenIndex tok)
  1258. {
  1259.     if (type == control.boolean_type)
  1260.          AddDependence(ThisType(), control.Boolean(), tok);
  1261.     else if (type == control.char_type)
  1262.          AddDependence(ThisType(), control.Character(), tok);
  1263.     else if (type == control.int_type)
  1264.          AddDependence(ThisType(), control.Integer(), tok);
  1265.     else if (type == control.long_type)
  1266.          AddDependence(ThisType(), control.Long(), tok);
  1267.     else if (type == control.float_type)
  1268.          AddDependence(ThisType(), control.Float(), tok);
  1269.     else // (type == control.double_type)
  1270.          AddDependence(ThisType(), control.Double(), tok);
  1271. }
  1272. #endif
  1273.  
  1274.  
  1275.