コードの改修 -- 名前付き共通領域の初期化の改善 マクロテーブル2017年08月01日 16:37

マクロテーブルに関する共通領域の初期化は、inittbl()で行っていましたが、 これをdata文で静的に初期化することとします。

Ratfor版のclook.riは以下の通りです。

# clook.ri
      common /clook/lastp,lastt,namptr,table
      integer lastp           # last used in namptr; init = 0
      integer lastt           # last used in table; init = 0
      integer namptr(MAXPTR)  # name pointers
      character table(MAXTBL) # actual text of names and defns
      data lastp/0/
      data lastt/0/

WATCOM fotran77版のfiles.fiは以下の通りです。

c clook.fi
      common /clook/lastp,lastt,namptr,table
      integer lastp           ! last used in namptr; init = 0
      integer lastt           ! last used in table; init = 0
      integer namptr(MAXPTR)  ! name pointers
      integer*1 table(MAXTBL) ! actual text of names and defns
      data lastp/0/
      data lastt/0/

files.ri、files.fiの変更により再コンパイルが必要になるファイルは、以下の通りです。

          instal.f
          lookup.f
          uninst.f

これらは、macroが動き出す前のファイルですので、macroを使用する版を再掲します。

instal()のRatfor版は以下の通りです。

# instal.r4 -- add name and definition to table
      subroutine instal(name,defn)
      character name(MAXTOK),defn(MAXDEF)
      integer length
      integer dlen,nlen
      include clook.ri

      nlen = length(name) + 1
      dlen = length(defn) + 1
      if (lastt+nlen+dlen > MAXTBL | lastp >= MAXPTR) {
         call putlin(name,ERROUT)
         call remark(':too many definitions.')
         }
      lastp = lastp + 1
      namptr(lastp) = lastt + 1
      call scopy(name,1,table,lastt+1)
      call scopy(defn,1,table,lastt+nlen+1)
      lastt = lastt + nlen + dlen
      return
      end

instal()のWATCOM fortran77版は以下の通りです。

c instal.f -- add name and definition to table
      include ratfor.def
      subroutine instal(name,defn)
      integer*1 name(MAXTOK),defn(MAXDEF)
      integer length
      integer dlen,nlen
      include clook.fi

      nlen = length(name) + 1
      dlen = length(defn) + 1
      if ((lastt+nlen+dlen .gt. MAXTBL) .or. (lastp .ge. MAXPTR)) then
         call putlin(name,ERROUT)
         call remark(':too many definitions.')
      end if
      lastp = lastp + 1
      namptr(lastp) = lastt + 1
      call scopy(name,1,table,lastt+1)
      call scopy(defn,1,table,lastt+nlen+1)
      lastt = lastt + nlen + dlen
      return
      end

lookup()のRatfor版は以下の通りです。

# lookup.r4 -- locate name, extract definition from table
      integer function lookup(name,defn)
      character name(MAXDEF),defn(MAXTOK)
      integer i,j,k
      include clook.fi

      for (i = lastp;i > 0; i = i - 1) {
         j = namptr(i)
         for (k = 1;name(k) == table(j) & name(k) != EOS; k = k + 1)
             j = j + 1
         if (name(k) == table(j)) {     # got one
             call scopy(table,j+1,defn,1)
             lookup = YES
             return
             }
         }
      lookup = NO
      return
      end

lookup()のWATCOM fortran77版は以下の通りです。

c lookup.f -- locate name, extract definition from table
      include ratfor.def
      integer function lookup(name,defn)
      integer*1 name(MAXDEF),defn(MAXTOK)
      integer i,j,k
      include clook.fi

      i = lastp
      while (i .gt. 0) do
         j = namptr(i)
         k = 1
         while ((name(k) .eq. table(j)) .and. (name(k) .ne. EOS)) do
             j = j + 1
             k = k + 1
         end while
         if (name(k) .eq. table(j)) then ! got one
             call scopy(table,j+1,defn,1)
             lookup = YES
             return
         end if
          i = i - 1
      end while
      lookup = NO
      return
      end

uninst()のRatfor版は以下の通りです。

# uninst.r4 -- undefine macro
      subroutine uninst(defnam)
      character defnam(MAXTOK)
      character name(MAXTOK),defn(MAXDEF)
      integer i,nlen,dlen
      integer length,equal
      include clook.fi

      lastt = 0
      for (i = 1; i <= lastp; i = i + 1) {
          call scopy(table,namptr(i),name,1)
          if (equal(defnam,name) == NO) {
              nlen = length(name) + 1
              call scopy(table,namptr(i) + nlen,defn,1)
              dlen = length(defn) + 1
              namptr(i) = lastt + 1
              call scopy(name,1,table,lastt+1)
              call scopy(defn,1,table,lastt+nlen+1)
              lastt = lastt + nlen + dlen
              }
          }
      lastp = lastp - 1
      return
      end

uninst()のWATCOM fortran77版は以下の通りです。

c uninst.f -- purge macro
      include ratfor.def
      subroutine uninst(defnam)
      integer*1 defnam(MAXTOK)
      integer*1 name(MAXTOK),defn(MAXDEF)
      integer i,nlen,dlen
      integer length,equal
      include clook.fi

      lastt = 0
      i = 1
      while (i .le. lastp) do
          call scopy(table,namptr(i),name,1)
          if (equal(defnam,name) .eq. NO) then
              nlen = length(name) + 1
              call scopy(table,namptr(i) + nlen,defn,1)
              dlen = length(defn) + 1
              namptr(i) = lastt + 1
              call scopy(name,1,table,lastt+1)
              call scopy(defn,1,table,lastt+nlen+1)
              lastt = lastt + nlen + dlen
          end if
          i = i + 1
      end while
      lastp = lastp - 1
      return
      end

また、inittbl()が不要になることで再コンパイルが必要になるファイルは、以下の通りです。

          define.f
          macro.f

実際の変更点については割愛します。

コメント

_ instacart promo code august 2017 ― 2017年08月20日 10:24

That is very attention-grabbing, You&#39;re a very professional blogger.

I have joined your feed and look ahead to in search of more
of your magnificent post. Additionally, I&#39;ve shared your site in my social networks

_ http://tinyurl.com/y9zkqjpq ― 2017年08月21日 16:26

An impressive share! I&#39;ve just forwarded this onto a friend who had been conducting a little
research on this. And he actually bought me lunch simply because I discovered it for
him... lol. So let me reword this.... Thanks for the meal!!
But yeah, thanx for spending time to talk about
this issue here on your web site.

_ tinyurl.com ― 2017年08月22日 04:31

I am curious to find out what blog platform you are using?
I&#39;m having some minor security problems with
my latest site and I&#39;d like to find something more secure.

Do you have any solutions?

_ http://tinyurl.com/y835ds9d ― 2017年08月25日 00:05

Having read this I thought it was really enlightening.
I appreciate you spending some time and energy to put this short article together.

I once again find myself personally spending a significant
amount of time both reading and leaving comments.

But so what, it was still worthwhile!

_ http://tinyurl.com ― 2017年08月25日 01:13

I appreciate, lead to I discovered exactly what I used to be having a look for.
You&#39;ve ended my 4 day lengthy hunt! God Bless you man. Have a great day.
Bye

_ http://tinyurl.com/ ― 2017年08月25日 06:30

Wonderful work! This is the kind of info that should be shared around the web.
Disgrace on Google for now not positioning this put up upper!
Come on over and discuss with my web site . Thanks =)

_ tinyurl.com ― 2017年08月25日 17:32

It&#39;s amazing to pay a quick visit this web page and reading
the views of all friends about this piece of writing, while
I am also keen of getting knowledge.

_ tinyurl.com ― 2017年08月25日 17:46

I used to be able to find good info from your blog articles.

_ http://tinyurl.com/ ― 2017年08月25日 23:26

Hi, i think that i saw you visited my blog so i came to go back the want?.I&#39;m
attempting to find things to enhance my site!I assume its adequate
to make use of some of your ideas!!

_ http://tinyurl.com/y93wjoxo ― 2017年08月26日 02:11

Someone essentially assist to make significantly posts I&#39;d state.
This is the very first time I frequented your web page and up to now?
I surprised with the analysis you made to make this particular put up incredible.

Magnificent process!

_ tinyurl.com ― 2017年08月28日 02:38

For the reason that the admin of this web page is working, no question very soon it will
be famous, due to its feature contents.

_ publix grocery delivery service ― 2017年09月28日 12:18

Hi to every body, it&#39;s my first pay a visit of this blog; this webpage
carries remarkable and really fine data for readers.

_ publix deli online ordering ― 2017年09月28日 22:47

After looking into a handful of the articles on your site, I seriously like your technique
of writing a blog. I book marked it to my bookmark website list and will
be checking back soon. Take a look at my website as well and
let me know how you feel.

_ publix grocery delivery service ― 2017年09月29日 07:06

Hmm it seems like your site ate my first comment (it was extremely long) so I guess I&#39;ll just sum it up what I submitted and say, I&#39;m thoroughly enjoying your blog.
I too am an aspiring blog blogger but I&#39;m still new to the whole thing.
Do you have any points for first-time blog writers? I&#39;d certainly appreciate it.

_ publix deli online ordering ― 2017年09月29日 14:58

Hiya! I know this is kinda off topic nevertheless I&#39;d figured I&#39;d
ask. Would you be interested in trading links or maybe guest writing a blog article
or vice-versa? My site goes over a lot of the same topics as yours and I think
we could greatly benefit from each other. If you happen to be interested
feel free to shoot me an e-mail. I look forward to hearing from you!
Superb blog by the way!

_ publix deli online ordering ― 2017年09月29日 22:12

I have been surfing on-line greater than three hours
lately, yet I never discovered any fascinating article like yours.
It is beautiful value enough for me. In my view, if all
webmasters and bloggers made just right content as you did, the net might be much more
helpful than ever before.

_ publix instacart ― 2017年09月30日 05:18

Great post.

_ publix online ordering ― 2017年09月30日 16:15

I&#39;ll right away snatch your rss feed as I can&#39;t to find your
email subscription hyperlink or e-newsletter service.
Do you have any? Please permit me recognise so that I could subscribe.
Thanks.

_ publix online ― 2017年09月30日 22:38

Wow, amazing blog layout! How long have you been blogging for?
you made blogging look easy. The overall look of your website is
magnificent, let alone the content!

_ publix deli online ordering ― 2017年10月01日 00:42

Hmm is anyone else experiencing problems with the images on this blog loading?
I&#39;m trying to find out if its a problem on my end or if it&#39;s the blog.

Any feedback would be greatly appreciated.

_ instacart publix ― 2017年10月01日 01:29

Outstanding post however , I was wondering if you could write a litte more on this topic?

I&#39;d be very grateful if you could elaborate a little bit
further. Bless you!

_ instacart coupon october ― 2017年10月02日 11:17

Hi! I simply would like to give you a big thumbs up for your great info you have got right here on this
post. I will be coming back to your website for more soon.

_ instacart coupon code october ― 2017年10月02日 20:54

Excellent web site. Plenty of helpful info here. I&#39;m sending it to
a few pals ans also sharing in delicious. And certainly, thank you in your sweat!

_ instacart coupon code ― 2017年10月03日 19:02

Fine way of explaining, and pleasant post to get information about my presentation subject, which i
am going to present in college.

_ coupon code for instacart ― 2017年10月04日 02:06

I absolutely love your blog and find the majority of your post&#39;s to be exactly I&#39;m looking for.

can you offer guest writers to write content in your case?
I wouldn&#39;t mind producing a post or elaborating on a lot of the subjects you write related
to here. Again, awesome site!

_ tender dating site free ― 2017年10月06日 15:45

It&#39;s very easy to find out any matter on web as
compared to books, as I found this piece of writing at this web
site.

_ tinder dating ― 2017年10月07日 02:00

I was suggested this web site by my cousin. I am not sure whether this post is written by him as nobody
else know such detailed about my trouble. You&#39;re wonderful!
Thanks!

_ tinder dating site free ― 2017年10月07日 05:12

I think that what you published was very logical. However, what about
this? what if you typed a catchier title? I ain&#39;t suggesting your content isn&#39;t
solid., however suppose you added a post title that grabbed
a person&#39;s attention? I mean コードの改修 -- 名前付き共通領域の初期化の改善 マクロテーブル: アナクロなコンピューターエンジニアのつぶやき is a little boring.

You might peek at Yahoo&#39;s home page and see how
they write news titles to get people to click.

You might add a related video or a pic or two
to grab people excited about what you&#39;ve got to say. Just
my opinion, it could bring your website a little livelier.

_ tinder dating site ― 2017年10月07日 05:54

Pretty section of content. I just stumbled upon your weblog and in accession capital to assert that I
acquire actually enjoyed account your blog posts. Any
way I&#39;ll be subscribing to your feeds and even I achievement
you access consistently quickly.

_ tender dating site free ― 2017年10月08日 14:22

This is really interesting, You&#39;re a very skilled blogger. I&#39;ve
joined your rss feed and look forward to seeking more
of your great post. Also, I&#39;ve shared your
website in my social networks!

_ tender dating site ― 2017年10月09日 10:45

Howdy would you mind sharing which blog platform you&#39;re using?
I&#39;m going to start my own blog in the near future but I&#39;m having a tough time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your design seems different then most blogs and I&#39;m looking
for something unique. P.S Apologies for
being off-topic but I had to ask!

_ tinder dating ― 2017年10月09日 18:06

My partner and I stumbled over here different web page and thought I
may as well check things out. I like what I see so now i am following you.
Look forward to looking at your web page repeatedly.

_ tender dating site ― 2017年10月09日 21:33

Greetings! This is my first comment here so I
just wanted to give a quick shout out and say I truly
enjoy reading through your posts. Can you recommend any other blogs/websites/forums that cover the same subjects?
Thanks!

_ tender dating site free ― 2017年10月10日 10:34

Hi, I do believe your site might be having internet browser compatibility problems.
Whenever I take a look at your web site in Safari, it looks fine however
when opening in IE, it&#39;s got some overlapping issues.
I simply wanted to give you a quick heads up! Other than that, wonderful site!

_ tinder dating site free ― 2017年10月10日 19:38

At this moment I am going to do my breakfast, later than having my breakfast coming over again to read
other news.

_ tinder dating site free ― 2017年10月11日 03:35

I am regular visitor, how are you everybody? This article posted at this website
is genuinely pleasant.

_ tinder dating site free ― 2017年10月11日 03:56

With havin so much written content do you ever run into any
problems of plagorism or copyright infringement?
My blog has a lot of unique content I&#39;ve either authored myself or outsourced but it looks like a
lot of it is popping it up all over the internet without
my agreement. Do you know any techniques to help
protect against content from being ripped off? I&#39;d genuinely appreciate it.

_ tinder dating site ― 2017年10月11日 09:21

I got this web page from my buddy who told me about
this web site and at the moment this time I am visiting this web site and
reading very informative posts here.

_ tinder dating site ― 2017年10月12日 03:10

It&#39;s fantastic that you are getting ideas from this article as well as from our dialogue made at this place.

_ tinder dating ― 2017年10月14日 01:45

Excellent weblog right here! Also your website quite a bit up very fast!
What web host are you the use of? Can I am getting your affiliate link
for your host? I want my website loaded up as quickly as yours lol

_ tinder dating site free ― 2017年10月15日 01:46

Hi my family member! I want to say that this post is amazing, great written and include almost all
vital infos. I would like to peer extra posts like this .

_ tinder dating site free ― 2017年10月25日 01:03

I am regular visitor, how are you everybody? This paragraph posted at this web site is really fastidious.

_ tinder ― 2017年10月25日 14:57

Hurrah, that&#39;s what I was seeking for, what a information! existing here at this webpage, thanks admin of this website.

_ tinder dating site free ― 2017年10月26日 18:57

This text is invaluable. When can I find out more?

_ tinder dating ― 2017年10月28日 03:06

This is a topic which is close to my heart... Many thanks!
Where are your contact details though?

_ tinder dating ― 2017年10月29日 02:33

Right away I am ready to do my breakfast, afterward having my breakfast coming over again to
read additional news.

_ tinder dating site ― 2017年10月29日 05:22

I&#39;m really loving the theme/design of your website.
Do you ever run into any internet browser compatibility issues?
A number of my blog readers have complained about my website not working correctly in Explorer but looks great in Firefox.
Do you have any ideas to help fix this problem?

_ tinder dating site ― 2017年10月29日 18:56

I was curious if you ever considered changing the layout of your website?
Its very well written; I love what youve got to say.
But maybe you could a little more in the way of content so people could connect with it better.

Youve got an awful lot of text for only having one or 2 pictures.
Maybe you could space it out better?

_ tinyurl.com ― 2017年12月03日 00:46

I enjoy, result in I found just what I was having a look for.
You have ended my 4 day long hunt! God Bless you man. Have a
nice day. Bye

_ tinyurl.com ― 2017年12月03日 10:43

Aw, this was an extremely good post. Taking the time
and actual effort to generate a top notch article… but what can I say… I procrastinate
a whole lot and never manage to get nearly anything done.

※コメントの受付件数を超えているため、この記事にコメントすることができません。

トラックバック