main.cc
changeset 873 dea39ef02847
parent 867 a435684a5223
child 878 89eb85bab58f
equal deleted inserted replaced
872:3d682f87c870 873:dea39ef02847
   119       /* Safety Software Technical Specification,           */
   119       /* Safety Software Technical Specification,           */
   120       /* Part 1: Concepts and Function Blocks,              */
   120       /* Part 1: Concepts and Function Blocks,              */
   121       /* Version 1.0 is Official Release                    */
   121       /* Version 1.0 is Official Release                    */
   122       /******************************************************/
   122       /******************************************************/
   123   printf("  s : allow use of safe extensions (e.g. SAFExxx data types))\n");
   123   printf("  s : allow use of safe extensions (e.g. SAFExxx data types))\n");
   124   printf("  n : allow use of nested comments\n");
   124   printf("  n : allow use of nested comments (an IEC 61131-3 v3 feature)\n");
       
   125   printf("  r : allow use of REF() operator  (an IEC 61131-3 v3 feature)\n");
   125   printf("  c : create conversion functions for enumerated data types\n");
   126   printf("  c : create conversion functions for enumerated data types\n");
   126   printf("\n");
   127   printf("\n");
   127   printf("%s - Copyright (C) 2003-2011 \n"
   128   printf("%s - Copyright (C) 2003-2014 \n"
   128          "This program comes with ABSOLUTELY NO WARRANTY!\n"
   129          "This program comes with ABSOLUTELY NO WARRANTY!\n"
   129          "This is free software licensed under GPL v3, and you are welcome to redistribute it under the conditions specified by this license.\n", PACKAGE_NAME);
   130          "This is free software licensed under GPL v3, and you are welcome to redistribute it under the conditions specified by this license.\n", PACKAGE_NAME);
   130 }
   131 }
   131 
   132 
   132 
   133 
   141   /* Default values for the command line options... */
   142   /* Default values for the command line options... */
   142   stage1_2_options.safe_extensions      = false; /* allow use of SAFExxx datatypes */
   143   stage1_2_options.safe_extensions      = false; /* allow use of SAFExxx datatypes */
   143   stage1_2_options.full_token_loc       = false; /* error messages specify full token location */
   144   stage1_2_options.full_token_loc       = false; /* error messages specify full token location */
   144   stage1_2_options.conversion_functions = false; /* Create a conversion function for derived datatype */
   145   stage1_2_options.conversion_functions = false; /* Create a conversion function for derived datatype */
   145   stage1_2_options.nested_comments      = false; /* Allow the use of nested comments. */
   146   stage1_2_options.nested_comments      = false; /* Allow the use of nested comments. */
       
   147   stage1_2_options.ref_operator         = false; /* Allow the use of REF() operator. */
   146   stage1_2_options.includedir           = NULL;  /* Include directory, where included files will be searched for... */
   148   stage1_2_options.includedir           = NULL;  /* Include directory, where included files will be searched for... */
   147 
   149 
   148   /******************************************/
   150   /******************************************/
   149   /*   Parse command line options...        */
   151   /*   Parse command line options...        */
   150   /******************************************/
   152   /******************************************/
   151   while ((optres = getopt(argc, argv, ":nhvfscI:T:")) != -1) {
   153   while ((optres = getopt(argc, argv, ":nhvfrscI:T:")) != -1) {
   152     switch(optres) {
   154     switch(optres) {
   153     case 'h':
   155     case 'h':
   154       printusage(argv[0]);
   156       printusage(argv[0]);
   155       return 0;
   157       return 0;
   156 
   158 
   163       stage1_2_options.full_token_loc = true;
   165       stage1_2_options.full_token_loc = true;
   164       break;
   166       break;
   165 
   167 
   166     case 's':
   168     case 's':
   167       stage1_2_options.safe_extensions = true;
   169       stage1_2_options.safe_extensions = true;
       
   170       break;
       
   171 
       
   172     case 'r':
       
   173       stage1_2_options.ref_operator = true;
   168       break;
   174       break;
   169 
   175 
   170     case 'c':
   176     case 'c':
   171       stage1_2_options.conversion_functions = true;
   177       stage1_2_options.conversion_functions = true;
   172       break;
   178       break;