Menu

% Lexer/Parser syntax error: expecting DOT, found ' '

Help
Jens M.
2016-09-27
2016-09-28
  • Jens M.

    Jens M. - 2016-09-27

    We compiled the most recent version of GDL on our Ubuntu 16.04 machine.
    The scripts I got from my colleague work just fine, and they use various GDL functions.
    The strange thing is that I can not execute any function on the prompt without getting an error message. However, if I assign the output of a function to a variable, the function is obviously executed properly.

    gdl

    GDL - GNU Data Language, Version 0.9.6

    • For basic information type HELP,/INFO
    • Default library routine search path used (GDL_PATH/IDL_PATH env. var. not set):
      +/usr/local/share/gnudatalanguage/lib
    • Please report bugs, feature or help requests and patches at:
      http://sourceforge.net/projects/gnudatalanguage/

    GDL> help
    % At $MAIN$
    Compiled Procedures:
    $MAIN$

    Compiled Functions:

    GDL> primes(10)
    % Lexer/Parser syntax error: expecting DOT, found '
    '

    GDL> help
    % At $MAIN$
    Compiled Procedures:
    $MAIN$

    Compiled Functions:

    GDL> a=primes(10)
    % Compiled module: PRIMES.

    GDL> help
    % At $MAIN$
    A LONG = Array[10]
    PRIMES UNDEFINED = <Undefined>
    Compiled Procedures:
    $MAIN$

    Compiled Functions:
    PRIMES

    GDL> print, a
    2 3 5 7 11 13 17 19 23 29

    GDL> print, primes(10)
    2 3 5 7 11 13 17 19 23 29

    GDL> print, !PATH
    /usr/local/share/gnudatalanguage/lib/dicom:/usr/local/share/gnudatalanguage/lib/envi:/usr/local/share/gnudatalanguage/lib:/home/myname/mymodel/:/home/myname/mymodel/xyzvlib/

    GDL>

    As you can see,
    primes(10)
    produces an error, but
    a=primes(10)
    or
    print, primes(10)
    does not. Also, why does PRIMES UNDEFINED = <Undefined> appear?

    As you can see, the PATH seems to be setup correctly (note that I changed my user name and the path to my model for privacy reasons).

    What is causing these lexer/parser errors? How can I prevent them?

     
  • Jens M.

    Jens M. - 2016-09-28

    Wow - thanks a lot. So this is normal in GDL. I tested a test version of IDL and there it works fine. So no problem with my GDL installation, but kind of strange in general that this his not implemented. Many thanks for the clarification!

     
  • GregJung

    GregJung - 2017-09-20

    This is in fact implemented in GDL, with a special compilation. I'm not sure that AUTO_PRINT_EXPR
    appears in the standard make - if not then add the line directly to config.h. Otherwise, add the following after the cmake command:

    ~~
    sed -e 's;/* #undef AUTO_PRINT_EXPR */;#define AUTO_PRINT_EXPR 1;' -i config.h
    ~~

     
  • giloo

    giloo - 2017-09-20

    Enabling AUTO_PRINT_EXPR is far from mimicking the "implied print" feature of recent IDLs.

    GDL> primes(10)
               2           3           5           7          11          13          17          19          23          29
    GDL> a=primes(10)
    GDL> a
    % Procedure not found: A
    % Execution halted at: $MAIN$          
    GDL>
    
     

Log in to post a comment.