From: ColinK <ibm...@im...> - 2021-10-30 04:01:14
|
Hi Leslie. While I am not very knowledgeable about the NetRexx compiler and its inner workings I was curious about this and decided to have a peek ( or peekto() in pipe lingo :-) ) I copied the testpipe code found in the "How to use a pipe in a NetRexx program" and got the same error as you received. It looks to me like the error message is being generated in RxClauser.nrx. In browsing the source one see the following . . . /* Here is the setup table for 'standard' NetRexx characters. */ /* Note: white space is handled before translation, for speed. */ /* This table handles the 'core' characters. Unicode letters and */ /* digits (>'\x7f') are handled in-line, when encountered. */ /* White space characters are also in the table. */ /* Note: the euro character (\u20ac) is not in the table as it */ /* would cause the table to become 8K long; it's special-cased. */ intrans=char[]- ('abcdefghijklmnopqrstuvwxyz'- ||'ABCDEFGHIJKLMNOPQRSTUVWXYZ'- ||'_$'- -- special symbol characters ||'1234567890'- ||'+-/*\\%&|=<>@'- -- '\\' here is '\' ||'.()[]"'';,'- ||'\t\f') outrans=char[]- ('ssssssssssssssssssssssssss'- -- 's' is non-digit symbol ||'ssssssssssssssssssssssssss'- ||'ss'- ||'nnnnnnnnnn'- -- 'n' is digit ||'oooooooooooo'- -- 'o' is operator ||'.()[]"'';,'- -- specials are themselves ||' ') -- whitespace . . . Note that the curly brace is not represented which. . . select when cchar=' ' then /* blank */ do -- special-case, for speed hadblank=pos; pos=pos+1; iterate; end when cchar<=tranmax then ctype=trantable[int(cchar)] when Character.isJavaIdentifierStart(cchar) then ctype='s' -- symbol start NETREXX-6 rvj 20130710 -- when cchar='\u20ac' then ctype='s' -- the euro (is a true JavaIdentifierStart now) when Character.isDigit(cchar) & - -- number start? Character.digit(cchar, 10)>=0 then ctype='n' -- base 10? otherwise *ctype=BAD* end . . . I think results in ctype being set to BAD. . . . . .and thus resulting in the error message you received. if *ctype=BAD* then do if rxt.program.flag.diag then do say '# BAD char ctype: '''ctype''''- Character.isLetter(cchar) Character.isDigit(cchar)- Character.isLetterOrDigit(cchar) Character.isDefined(cchar) - Character.isJavaIdentifierStart(cchar) Character.isJavaIdentifierPart(cchar) end *signal RxQuit(rxt, tok, 'invalid.character', cchar,-** ** Rexx(int(cchar)).d2x(4))* end Since it looks like the only piece of NetRexx that uses the curly braces is related to the pipes stuff one might suppose that there must be support for pipes built into the compiler and so we should find some pipe references somewhere in the compiler programs. Apparently not. . . CK@DESKTOP-C91GVBB MINGW64 ~/NetRexx/v401/src/org/netrexx/process (master) $ grep -i pipe * NrVersion.nrx: pipesversion = 'Pipelines for NetRexx version 'version NrVersion.nrx: pipescopyright = 'Copyright (c) E. J. Tomlinson, 1999-2011. All rights reserved.\nParts Copyright (c) RexxLA, 2011-2021. All rights reserved.' NrVersion.nrx: method getPipesVersion() NrVersion.nrx: return this.pipesversion NrVersion.nrx: method getPipesCopyright() NrVersion.nrx: return this.pipescopyright CK@DESKTOP-C91GVBB MINGW64 ~/NetRexx/v401/src/org/netrexx/process (master) $ cd ~/NetRexx/v308/src/org/netrexx/process CK@DESKTOP-C91GVBB MINGW64 ~/NetRexx/v308/src/org/netrexx/process (master) $ grep -i pipe * NrVersion.nrx: pipesversion = 'Pipelines for NetRexx version 'version NrVersion.nrx: pipescopyright = 'Copyright (c) E. J. Tomlinson, 1999-2011. All rights reserved.\nParts Copyright (c) RexxLA, 2011-2020. All rights reserved.' NrVersion.nrx: method getPipesVersion() NrVersion.nrx: return this.pipesversion NrVersion.nrx: method getPipesCopyright() NrVersion.nrx: return this.pipescopyright CK@DESKTOP-C91GVBB MINGW64 ~/NetRexx/v308/src/org/netrexx/process (master) $ I am going to have to leave this interesting conumdrum to the NetRexx experts that know how the compiler works to comment further. I am probably way off base anyhow ( more than likely I am not looking in the place :-) ) Sorry I couldn't be of much help on this one. Cheers Colin K [PS. Should this be sent to the groups.io NetRexx list?? ] On 2021-10-28 03:36, J Leslie Turriff wrote: > I'm trying to use a simple pipeline in a NetRexx routine, but nrc doesn't like my > variable substitution: > > ~/bin/NetRexx > | $ echo $JAVA_HOME > | > | @05:27:11,leslie@pinto rc=0 > | ~/bin/NetRexx > | $ echo $CLASSPATH > | .:/home/leslie/bin/NetRexx/:/usr/java/jdk-17:/usr/local/NetRexx-4.01-GA/lib/NetRexxF.jar > | @05:27:21,leslie@pinto rc=0 > | ~/bin/NetRexx > | $ cat newTree.nrx > | -- .-----------------------------------------------------------------------. -- > | -- | Change Log | -- > | -- |Version Date Description | -- > | -- |------- ---------- ----------------------------------------------------| -- > | -- | | -- > | -- |1.0 2021-10-27 Creation | -- > | -- '-----------------------------------------------------------------------' -- > | import org.netrexx.njpipes.pipes. > | trace off > | parse arg treeBase > | treePipe(Rexx(treeBase)) > | exit 0 > | ------------------------------------------------------------------------------- > | method treePipe(treeArguments) > | pipe (fixTree) > | command /usr/bin/tree {treeArguments} > | | tree: split at /[/ > | | merge: specs select 1 1-* next > | select 0 1-* next > | select 2 1-* next > | | console > | ? tree: split at /]/ | attrs: > | ? attrs: | merge: > | --===========================================================================-- > | @05:27:31,leslie@pinto rc=0 > | ~/bin/NetRexx > | $ nrc newTree.nrx > | NetRexx portable processor 4.01-GA build 573-20210320-2000 > | Copyright (c) RexxLA, 2011,2021. All rights reserved. > | Parts Copyright (c) IBM Corporation, 1995,2008. > | Program newTree.nrx > | 16 +++ command /usr/bin/tree {treeArguments} > | +++ ^ > | +++ Error: Unexpected character found in source: '{' (hexadecimal encoding: 007B) > | Compilation of 'newTree.nrx' failed [one error] > | @05:27:40,leslie@pinto rc=2 > > I can't see what I'm doing differently to what is described in "How to use a pipe in a > NetRexx program", page 24 of "Pipelines Guide and Reference"; I tried first putting the > pipeline into the implicit main() method, then in a separate method; neither worked, so I > looked through the examples in the NetRexx package and noticed the import statement, but > adding that didn't help either. > What am I doing wrong? > > Leslie > -- > Distribution: openSUSE Leap 15.3 x86_64 > java version "17" 2021-09-14 LTS > Java(TM) SE Runtime Environment (build 17+35-LTS-2724) > Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing) > NetRexx portable processor 4.01-GA build 573-20210320-2000 > > > _______________________________________________ > netrexx-pipelines mailing list > net...@li... > https://lists.sourceforge.net/lists/listinfo/netrexx-pipelines |