]> git.tuebingen.mpg.de Git - lopsub.git/blobdiff - config_file.l
lopsub-1.0.5
[lopsub.git] / config_file.l
index 58aab83fa4def89a84eefe6bf74f00e3a6f9b7dc..1fae6dba4af300a4bb2ad6202d987806ee1e6b4d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2016 Andre Noll <maan@tuebingen.mpg.de>
  *
 /*
  * Copyright (C) 2016 Andre Noll <maan@tuebingen.mpg.de>
  *
- * Licensed under the LGPL v3, see http://www.gnu.org/licenses/lgpl-3.0.html
+ * Licensed under the LGPL v3, see https://www.gnu.org/licenses/lgpl-3.0.html
  */
 
  /* We don't want symbols to clash with those of other flex users. */
  */
 
  /* We don't want symbols to clash with those of other flex users. */
@@ -21,7 +21,7 @@
 %s SC_SCANNING
 
 IDENTIFIER [a-zA-Z]+[a-zA-Z0-9_-]*
 %s SC_SCANNING
 
 IDENTIFIER [a-zA-Z]+[a-zA-Z0-9_-]*
-EQUALS [[:space:]]*=[[:space:]]*
+EQUALS [[:blank:]]*=[[:blank:]]*
 OPTION [a-zA-Z]+[a-zA-Z0-9_-]*
 
 %{
 OPTION [a-zA-Z]+[a-zA-Z0-9_-]*
 
 %{
@@ -47,10 +47,10 @@ OPTION [a-zA-Z]+[a-zA-Z0-9_-]*
 %%
 
  /* skip comments and whitespace */
 %%
 
  /* skip comments and whitespace */
-^[[:space:]]*#.*\n ;
-[[:space:]]|\n+ ;
+^[[:blank:]]*#.*\n ;
+[[:blank:]]|\n+ ;
 
 
-<INITIAL,SC_SCANNING>\[[[:space:]]*{IDENTIFIER}[[:space:]]*\][[:space:]]*\n {
+<INITIAL,SC_SCANNING>\[[[:blank:]]*{IDENTIFIER}[[:blank:]]*\][[:blank:]]*\n {
        int i, j;
        const char *subcmd = yyget_extra(yyscanner)->subcmd;
 
        int i, j;
        const char *subcmd = yyget_extra(yyscanner)->subcmd;
 
@@ -71,9 +71,9 @@ OPTION [a-zA-Z]+[a-zA-Z0-9_-]*
                BEGIN(SC_SCANNING);
 }
 
                BEGIN(SC_SCANNING);
 }
 
-<SC_SCANNING>{OPTION}[[:space:]]*\n add_option(yyscanner);
+<SC_SCANNING>{OPTION}[[:blank:]]*\n add_option(yyscanner);
 
 
-<SC_SCANNING>{OPTION}({EQUALS}|[[:space:]]+) {
+<SC_SCANNING>{OPTION}({EQUALS}|[[:blank:]]+) {
        int ret = add_option(yyscanner);
 
        if (ret < 0)
        int ret = add_option(yyscanner);
 
        if (ret < 0)
@@ -285,6 +285,7 @@ free_argv:
 }
 
 #if 0
 }
 
 #if 0
+/* flex -o t.c config_file.l && cc -o tcf t.c */
 int main(void)
 {
        char buf[100 * 1024];
 int main(void)
 {
        char buf[100 * 1024];
@@ -300,7 +301,7 @@ int main(void)
                exit(EXIT_FAILURE);
        argc = ret;
        for (i = 0; i < argc; i++)
                exit(EXIT_FAILURE);
        argc = ret;
        for (i = 0; i < argc; i++)
-               printf("argv[%d]: %s\n", i, rargv[i]);
+               printf("argv[%d]: %s\n", i, argv[i]);
        return EXIT_SUCCESS;
 }
 #endif
        return EXIT_SUCCESS;
 }
 #endif