quick.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

   

space.gif

   

space.gif

  ../images/main/bulllet_4dots_orange.gif Forward Reference

The Vera language supports the typedef class construct for forward referencing of a class declaration. This allows for the compiler to read a file from beginning to end without concern for the positioning of the class declaration.

   

space.gif

   

space.gif

  ../images/main/bullet_star_pink.gif Example : Forward Reference
   

space.gif


  1 typedef class A;
  2 
  3 class B {
  4   A  a;
  5   task new () {
  6     a = new();
  7     a.print();
  8   }
  9 }
 10 
 11 program forward_ref {
 12   B b = new();
 13 }
You could download file forward_ref.vr here
   

space.gif


 1 // Below code can be in another file
 2 class A {
 3   task print () {
 4     printf("I am in seprate file\n");
 5   }
 6 }
You could download file class_a.vr here
   

space.gif

  ../images/main/bullet_star_pink.gif Simulation : Forward Reference
   

space.gif

 I am in seprate file
   

space.gif

   

space.gif

   

space.gif

   

space.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

  

Copyright © 1998-2014

Deepak Kumar Tala - All rights reserved

Do you have any Comment? mail me at:deepak@asic-world.com