//ssyy
 private void VisitLabelDeclaration(label_node ln)
 {
     members[ln] = (int)bw.BaseStream.Position;
     bw.Write(ln.name);
     WriteDebugInfo(ln.Location);
 }
Example #2
0
 public goto_statement(label_node v_label, location v_location)
     : base(v_location)
 {
     _label = v_label;
 }
        private label_node GetLabel(int offset)
        {
            definition_node dn = null;
            if (members.TryGetValue(offset, out dn))
                return dn as label_node;
            label_node lab = null;
            
            int pos = (int)br.BaseStream.Position;
            br.BaseStream.Seek(start_pos + offset, SeekOrigin.Begin);

            string s = br.ReadString();
            location loc = ReadDebugInfo();
            lab = new label_node(s, loc);
            //members[offset] = lab;
            AddMember(lab, offset);            

            br.BaseStream.Seek(pos, SeekOrigin.Begin);
            return lab;
        }
Example #4
0
 public labeled_statement(label_node v_label, statement_node v_statement, location v_location)
     : base(v_location)
 {
     _label     = v_label;
     _statement = v_statement;
 }
Example #5
0
 public goto_statement(label_node v_label, location v_location)
     :base(v_location)
 {
     _label = v_label;
 }
Example #6
0
 public labeled_statement(label_node v_label, statement_node v_statement, location v_location)
     : base(v_location)
 {
     _label = v_label;
     _statement = v_statement;
 }
 public SymbolInfo(label_node lab)
 {
     _sym_info = lab;
     _access_level = access_level.al_public;
     _symbol_kind = symbol_kind.sk_none;
 }
 //ssyy
 public label_node add_label_declaration(string name, location loc)
 {
     check_name_free(name, loc);
     label_node lab = new label_node(name, loc);
     switch (converting_block())
     {
         case block_type.function_block:
             {
                 common_function_node top_func = _func_stack.top();
                 top_func.label_nodes_list.Add(lab);
                 top_func.scope.AddSymbol(name, new SymbolInfo(lab));
                 break;
             }
         case block_type.namespace_block:
             {
                 _cmn.scope.AddSymbol(name, new SymbolInfo(lab));
                 _cmn.labels.Add(lab);
                 break;
             }
         default:
             {
                 AddError(loc, "LABEL_CAN_NOT_BE_DECLARED_HERE");
                 break;
             }
     }
     return lab;
 }