0

I am using antlr v3.4 C target, here is how I add the data into a vector:

options
{
     language = 'C';
}

scope Common_Param_Vec {
   pANTLR3_VECTOR common_params;   
}

bus 
   @init
   {  
      printf("In bus init");
      $Common_Param_Vec::common_params = antlr3VectorNew(10);
      printf("In bus init 2");
      $Common_Param_Vec::common_params->factoryMade = false;
   }
   :  common_param+   
      EOF 
   ;

The program crashes at the line "$Common_Param_Vec::common_params = antlr3VectorNew(10);", the statement is so simple, I am not sure what could be wrong.

my_question
  • 3,075
  • 2
  • 27
  • 44

1 Answers1

1

Change to pointer ..

pANTLR3_VECTOR *common_params;

tncas
  • 66
  • 1