EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024  2025  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024  2025 
<== Date ==> <== Thread ==>

Subject: Re: #define usage in Sequencer
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: Hyung Jin Kim <hjkim09 at gmail.com>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Sun, 2 Apr 2023 15:22:47 +0000
I believe I understand the problem.  This is from the sequencer manual:

Depending on the application, it might be useful to pre-process the SNL source with a C pre-processor (cpp). Using the C pre-processor allows you to include other SNL files, define macros, and perform conditional compilation. snc supports this by interpreting cpp-generated line markers, so that error and warning messages refer to the line numbers in the un-pre-processed SNL source.

The build rules that the sequencer adds to the EPICS build system are such that files with the extension .st are preprocessed, while those with the extension .stt are not.


So if you name your file .stt then the C pre-processor is not run.  But #define is handled by the C pre-processor.  So you need to name your file .st not .stt.

I tested this on my system, and I get the same error as you if the file is named .stt, but it works fine if it is named .st.

Mark




From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Hyung Jin Kim via Tech-talk <tech-talk at aps.anl.gov>
Sent: Sunday, April 2, 2023 7:25 AM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: #define usage in Sequencer
 
Dear All,

I tried to set a size of array using predefined value in sequencer code as follows:

program sncTest

#define A_SIZE 3

double test_array[A_SIZE];
assign test_array to {"{S}:r1", "{S}:r2", "{S}:r3"};
monitor test_array;
....

However, it gives an error when it is compiled. #define is not allowed in sequencer. An used sequencer version is 2-2-6.

../sncTest.stt:3: lexical error: invalid character
../sncTest.stt:3: syntax error near token ''
../sncTest.stt:3: parser giving up

Thanks,

Replies:
Re: #define usage in Sequencer Hyung Jin Kim via Tech-talk
References:
#define usage in Sequencer Hyung Jin Kim via Tech-talk
Re: #define usage in Sequencer Mark Rivers via Tech-talk

Navigate by Date:
Prev: Re: #define usage in Sequencer Mark Rivers via Tech-talk
Next: Re: #define usage in Sequencer Hyung Jin Kim via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024  2025 
Navigate by Thread:
Prev: Re: #define usage in Sequencer Mark Rivers via Tech-talk
Next: Re: #define usage in Sequencer Hyung Jin Kim via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024  2025