|  | 
|  |  | 
 |  
|  |  |  |  
|  |  | 
 |  
|  |  | 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. |  
|  |  | 
 |  
|  |  |  |  
|  |  | 
 |  
|  |  | Example : Forward Reference |  
|  |  | 
 |  
|  |  | 
  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 |  
|  |  | 
 |  
|  |  | 
 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 |  
|  |  | 
 |  
|  |  | Simulation : Forward Reference |  
|  |  | 
 |  
|  |  |  I am in seprate file
 |  
|  |  | 
 |  
|  |  | 
 |  
|  |  | 
 |  
|  |  |  |  
|  |  | 
 |  |  | 
|  
 |  
 |  
 | 
| 
 | 
|    |  
| Copyright © 1998-2025 |  
| Deepak Kumar Tala - All rights reserved |  
| Do you have any Comment? mail me at:deepak@asic-world.com
 |  |