Menu

Cobc -E option outputs to screen.

Anonymous
2019-04-24
2019-05-09
  • Anonymous

    Anonymous - 2019-04-24

    If you run Cobc PROG.COB -E you used to get another pre-processed file with .i extension

    Cobc V2.0-rc3.0 outputted the source code to a .i file whereas V3.0 output to screen.
    Is this a change or am I mis-configuring it ??.

    Thanks

     
  • David Wall

    David Wall - 2019-04-24

    Forget to login before posting - also found the problem - Cobc was changed - will workaround.

     

    Last edit: David Wall 2019-04-24
    • Simon Sobisch

      Simon Sobisch - 2019-04-24

      The behavior was changed back to the old one (1.1 I guess) as it is the same that other compilers have and allows preprocessors to compile from the result using stdin. I suggest to add -o file.i to have a file output with any version.
      Note: you may choose to use the listing options, too.

      Can you please check that the NEWS file has an entry for the changed command line option?

       
  • David Wall

    David Wall - 2019-04-24

    Yes - the rc3 News file identifies the removal of the output with the -E option.
    I used the -o filename option & found that it also gave me a .dll - so added -x
    which supressed the .dll. ie: Cobc -F -E -x -o filename - runs perfectly - thanks.

     
    • Simon Sobisch

      Simon Sobisch - 2019-04-27

      -x produces an executable.
      I suggest using cobc -F -fsyntax-only -E -o filename.i filename.cob or, if you actually want more than the preprocessed source (which currently still removes comments):
      cobc -F -E -fsyntax-only -T filename.lst filename.cob

       
  • Anonymous

    Anonymous - 2019-04-27

    Simon, Actually it 'doesn't' produce an executable. -F -E -x -o filename does exactly what I want.
    It must be because the -x suppresses the .dll output but is also suppressed from producing a .exe by the presence of the -E. However - it works for me & thanks for the heads up.
    I'll look at the -fsyntax-only to see what that gives.

     
  • David Wall

    David Wall - 2019-04-27

    Shoot - I did it again - posted before Login - darn - sorry Mod..

     
  • David Wall

    David Wall - 2019-05-08

    Simon, would it be possible to make the pre-processor output the source 'excluding any commented lines' irrespective of wether the input file is Fixed or Free Format.

    I'm playing with Arnold Trimbley's recreation of the Eliza program and it's effectively in Fixed Format (with * in col 7) - the problem I've come up against is that telling Cobc the input format is Fixed works fine - but telling it the the input format is Free - whilst it appears to ignore any commented lines in the output - actually seems to process the commented line.

    I am getting an error on line 645 which says the following:

      *    REPLIES FOR EACH KEYWORD, AND SOME REPLIES INCLUDE TEXT   *
    

    Cobc processes the line & recognises the INCLUDE verb and goes looking for a 'TEXT' file.
    Then it complains about a missing fullstop.

    Ignoring completely any line beginning with an * would then eliminate this problem.
    Thanks

     
  • Vincent (Bryan) Coen

    Regarding the comment * in cc7, this only workds for FIXED format not free as that requires a *> to signify a comment.

    If you have enbedded FREE format code within a fixed source then the use of :
    >>source free

    with the end of that a :

    source fixed

    will allow the compiler to know what it is dealing with.

    Above said without knowing the Eliza soource.

    Your comment regarding omitting blank lines via -P or -E or --save-temps is a little moot as it has been around since 0.33 or earlier and is at times a pain. Prehaps an extra command to stop it.

    I 'assume' your comment regarding INCLUDE refers to the COPY verb as panlib code is not present in GC as far as I know (including +++INCLUDE)..

     
  • David Wall

    David Wall - 2019-05-08

    Vincent - I appreciate your comments & recognise that using >>source free & >>source fixed would eliminate the problem - BUT - I'm specifically talking about the preprocessor here:
    ie: Cobc Source-file -F -E -x -o fred.txt which merely outputs fred.txt without any compilation.
    If Source-file was in fixed-format with no numerics in 1-6 but the occasional * in 7 then the pre-processor actually looks at the commented lines & processes them - resulting in the error message I got when a commented line actually contained a verb.
    This still does seem a bit illogical - since you would 'never' have an * as the first character of a free format line - unless I suppose the previous line said Compute abc = def and the next line said * ghi.
    which does sound a bit obscure.

    Also - I don't recall saying anything about blank lines -P or -E so can't comment on that and as I explained above - the include verb was in a commented line & should have been ignored anyway.

     
  • Vincent (Bryan) Coen

    The free format standard is NOT the same as the fixed format one and a '*' in cc7 without a '>' in cc8 will create errors..

    Simply put you cannot compile a fixed format source as free unless you convert the source file first to free by hand or using the changeformat tool.

    As for ' logical ' the compiler does not know the programmer has not made any mistakes in coding so does not assume.

     

Anonymous
Anonymous

Add attachments
Cancel





Auth0 Logo