文脈検索2016年01月23日 22:41

文脈検索は、ptscan()で行う。これで使う文字パターンはoptpat()で作成する。

optpat()のRATFOR版は、以下の通り。

# optpat.r4 -- make pattern if specified at lin(i)
      integer function optpat(lin,i)
      character lin(MAXLINE)
      integer i
      integer makpat
      include cpat.ri

      if (lin(i) == EOS)
          i = ERR
      else if (lin(i+1) == EOS)
          i = ERR
      else if (lin(i+1) == lin(i)) # repeated delimiter
          i = i + 1                  # existing pattern alone
      else
          i = makpat(lin,i+1,lin(i),pat)
      if (pat(1) == EOS)
          i = ERR
      if (i == ERR) {
          pat(1) = EOS
          optpat = ERR
      } else
          optpat = OK
      return
      end

WATCOM Fortran77版は以下の通り。

c optpat.f -- make pattern if specified at lin(i)
      integer function optpat(lin,i)
      integer*1 lin(81)                 ! MAXLINE(81)
      integer i
      integer makpat
      include cpat.fi

      if (lin(i) .eq. -2) then ! EOS(-2)
          i = -3                        ! ERR(-3)
      else if (lin(i+1) .eq. -2) then   ! EOS(-2)
          i = -3                        ! ERR(-3)
      else if (lin(i+1) .eq. lin(i)) then ! repeated delimiter
          i = i + 1                     ! leave existing pattern alone
      else
          i = makpat(lin,i+1,lin(i),pat)
      end if

      if (pat(1) .eq. -2) then ! EOS(-2)
          i = -3
      end if
      if (i .eq. -3) then
          pat(1) = -2                   ! EOS(-2)
          optpat = -3                   ! ERR(-3)
      else
          optpat = -2                   ! OK(-2)
      end if
      return
      end

文脈検索するptscan()は以下のようになる。

RATFOR版は、以下の通り。

# ptscan.r4 -- scan for next occurrence of pattern
      integer function ptscan(way,num)
      integer way,num
      integer gettxt,nextln,prevln
      integer match
      integer k
      include cpat.ri
      include ctxt.ri
      include clines.ri

      num = curln
      loop
          if (way == FORWARD)
              num = nextln(num)
          else
              num = prevln(num)
          k = gettxt(num)
          if (match(txt,pat) == YES) {
              ptscan = OK
              return
          }
      until (num == curln)
      ptscan = ERR
      return
      end

WATCOM Fortran77版は以下の通り。

c ptscan.f -- scan for next occurrence of pattern
      integer function ptscan(way,num)
      integer way,num
      integer gettxt,nextln,prevln
      integer match
      integer k
      include cpat.fi
      include ctxt.fi
      include clines.fi

      num = curln
      loop
          if (way .eq. 1) then          ! FORWARD(1)
              num = nextln(num)
          else
              num = prevln(num)
          end if
          k = gettxt(num)
          if (match(txt,pat) .eq. 1) then ! YES(1)
              ptscan = -2               ! OK(-2)
              return
          end if
      until (num .eq. curln)
      ptscan = -3                       ! ERR(-3)
      return
      end

ここでincludeされるcpatは以下のとおり。

RATFOR版は、

# cpat.ri
      common /cpat/pat
      character pat(MAXPAT) # pattern

WATCOM Fortran77版は、

c cpat.fi
      common /cpat/pat
      integer*1 pat(1001)               ! MAXPAT(1001) pattern

また、ctxtは以下のとおり。

RATFOR版は、

# ctxt.ri
      common /ctxt/txt
      character txt(MAXLINE) # text line for matching and output

WATCOM Fortran77版は、

c ctxt.fi
      common /ctxt/txt
      integer*1 txt(81)               ! MAXLINE(81) text line for matching and output

ptscan()で使用する、nextln()、prevln()は、それぞれ、次の行、前の行を取り出してくる。

nextln()のRATFOR版は、

# nextln.r4 -- get line after "line"
      integer function nextln(line)
      integer line
      include clines.ri

      nextln = line + 1
      if (nextln > lastln) then
          nextln = 0
      end if
      return
      end

WATCOM Fortran77版は、

c nextln.f -- get line after "line"
      integer function nextln(line)
      integer line

      include clines.fi

      nextln = line + 1
      if (nextln .gt. lastln) then
          nextln = 0
      end if
      return
      end

prevln()のRATFOR版は、

# prevln.r4 -- get line before "line"
      integer function prevln(line)
      integer line

      include clines.ri

      prevln = line - 1
      if (prevln < 0) 
          prevln = lastln
      return
      end

WATCOM Fortran77版は、

c prevln.f -- get line before "line"
      integer function prevln(line)
      integer line

      include clines.fi

      prevln = line - 1
      if (prevln .lt. 0) then
          prevln = lastln
      end if
      return
      end

コメント

_ quest bars ― 2016年02月09日 08:09

Hello, just wanted to tell you, I loved this article.
It was funny. Keep on posting!

_ quest bars ― 2016年02月09日 13:23

I&#39;d like to find out more? I&#39;d care to find out some additional
information.

_ quest bars ― 2016年02月19日 17:21

Hi there all, here every one is sharing these familiarity,
so it&#39;s pleasant to read this web site, and I
used to pay a visit this blog all the time.

_ plenty of fish dating site of free dating ― 2016年02月23日 16:23

bookmarked!!, I like your web site!

_ bernie sanders ― 2016年04月01日 19:19

What&#39;s up, after reading this awesome paragraph
i am also delighted to share my familiarity here with colleagues.

_ krogerfeedback.com ― 2016年06月06日 00:31

Great blog! Is your theme custom made or did you download
it from somewhere? A theme like yours with a few simple adjustements would really
make my blog jump out. Please let me know where you got your design. Appreciate it

_ Mincraft ― 2016年07月03日 07:15

Hello there! Quick question that&#39;s totally off topic.
Do you know how to make your site mobile friendly?
My weblog looks weird when viewing from my iphone4.
I&#39;m trying to find a template or plugin that might be able to fix
this problem. If you have any recommendations, please share.
Thanks!

_ www.krogerfeedback.com ― 2016年07月14日 17:58

My brother suggested I might like this web site. He was entirely right.
This post actually made my day. You cann&#39;t imagine simply how much time I had spent for
this information! Thanks!

_ www.krogerfeedback.com ― 2016年07月26日 04:48

Hi there Dear, are you genuinely visiting this web site on a regular basis, if so afterward you will definitely obtain fastidious knowledge.

_ quest bars ― 2016年09月09日 04:31

Wonderful blog! I found it while browsing on Yahoo News.
Do you have any tips on how to get listed in Yahoo News?
I&#39;ve been trying for a while but I never seem to get there!
Appreciate it

_ The Heel Lift ― 2016年09月11日 09:24

I&#39;m gone to tell my little brother, that he should also pay a quick
visit this weblog on regular basis to obtain updated from latest
news update.

_ ShoeLifts ― 2016年09月14日 01:11

I&#39;m gone to tell my little brother, that he should also go to see this webpage on regular basis to get updated from latest gossip.

_ Windows 10 Free Upgrade ― 2016年09月14日 17:52

Hey there just wanted to give you a quick heads up and let you know a few of the pictures aren&#39;t loading correctly.

I&#39;m not sure why but I think its a linking issue. I&#39;ve tried it in two different web browsers and both show the same outcome.

_ Windows 10 Free Upgrade ― 2016年09月16日 16:44

Hello, after reading this amazing article i am also delighted to share my familiarity here
with friends.

_ quest bars ― 2016年09月25日 00:27

Good post. I learn something totally new and challenging on blogs I stumbleupon everyday.
It will always be helpful to read content from other authors and use something from their sites.

_ quest bars ― 2016年09月25日 09:31

This is very interesting, You are a very skilled blogger.
I have joined your feed and look forward to seeking more of your
fantastic post. Also, I have shared your web site in my
social networks!

_ shoe shopping ― 2016年09月26日 13:33

Hello, i think that i saw you visited my weblog so
i got here to ?go back the want?.I&#39;m attempting to to find things to improve
my site!I suppose its adequate to use some
of your concepts!!

_ common foot problems ― 2016年09月26日 14:43

Absolutely composed content material, thanks for selective information.

_ ankle boots ― 2016年09月26日 23:52

I would like to thank you for the efforts you have put in penning this website.
I am hoping to view the same high-grade blog
posts from you in the future as well. In truth, your creative writing abilities has inspired me to get my
very own blog now ;)

_ reading hockey ― 2016年09月27日 01:10

Hmm it appears like your blog 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 recommendations for novice blog writers?
I&#39;d definitely appreciate it.

_ achilles back heel ― 2016年09月27日 05:50

Thank you for every other magnificent article. Where else could anybody get that
type of info in such an ideal way of writing? I&#39;ve a presentation next
week, and I am at the look for such information.

_ unblocked minecraft sweet and awesome ― 2016年10月03日 21:01

If you would like to increase your knowledge simply keep visiting this web site and be updated with the most up-to-date news posted here.

_ quest bars ― 2016年10月06日 00:40

Wow, this article is nice, my younger sister
is analyzing these things, therefore I am going to convey her.

_ minecraft ― 2016年10月13日 10:09

Very good write-up. I certainly love this site. Continue
the good work!

_ gamefly 3 month free trial ― 2016年11月15日 23:49

Howdy! This post could not be written any better!
Reading through this post reminds me of my previous roommate!
He always kept talking about this. I&#39;ll forward this article
to him. Pretty sure he will have a very good read.
Thank you for sharing! Gamefly 3 month free trial

_ quest bars natural ― 2016年11月20日 02:36

Hello There. I found your blog using msn. This is an extremely well written article.
I will be sure to bookmark it and return to read more of your useful info.
Thanks for the post. I&#39;ll certainly comeback.

_ tinyurl.com ― 2016年12月02日 00:36

Wow, this article is good, my younger sister is analyzing such
things, therefore I am going to tell her.

_ free dating sites no fees ― 2016年12月10日 09:07

Hmm it appears like your website ate my first comment (it was extremely long) so I guess I&#39;ll just sum
it up what I had written and say, I&#39;m thoroughly enjoying your blog.
I as well am an aspiring blog blogger but I&#39;m still new to the whole thing.
Do you have any tips for newbie blog writers? I&#39;d
certainly appreciate it.

_ Gamefly ― 2016年12月18日 13:52

It&#39;s going to be ending of mine day, but before finish I
am reading this enormous post to increase my experience.

_ Gamefly ― 2016年12月19日 00:53

Hello outstanding blog! Does running a blog such as this take a lot of work?

I have virtually no expertise in computer programming but I was hoping
to start my own blog soon. Anyhow, if you have any suggestions or techniques for new blog owners please share.
I understand this is off subject however I just wanted to ask.
Thanks!

_ Gamefly Free Trial ― 2016年12月19日 21:23

Link exchange is nothing else but it is only placing the other person&#39;s webpage link on your page at appropriate place and other person will also
do similar in favor of you.

_ Gamefly ― 2016年12月21日 10:06

Hiya! I know this is kinda off topic nevertheless I&#39;d figured I&#39;d ask.
Would you be interested in exchanging 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 believe we could greatly benefit from each other.
If you happen to be interested feel free to shoot me an email.
I look forward to hearing from you! Superb blog by the way!

_ www.krogerfeedback.com ― 2016年12月25日 08:20

Please let me know if you&#39;re looking for
a article author for your weblog. You have some really good posts and I feel I would be a good asset.

If you ever want to take some of the load off, I&#39;d really like to write
some material for your blog in exchange for
a link back to mine. Please blast me an email if interested.
Kudos!

_ www.krogerfeedback.com ― 2016年12月25日 09:09

This is a topic that&#39;s close to my heart...
Cheers! Exactly where are your contact details though?

_ www.krogerfeedback.com ― 2016年12月26日 00:01

Fine way of describing, and fastidious piece of writing to obtain data on the
topic of my presentation topic, which i am going to present in university.

_ www.krogerfeedback.com ― 2016年12月26日 03:19

hello there and thank you for your info – I&#39;ve certainly picked up something
new from right here. I did however expertise several
technical issues using this site, since I experienced
to reload the web site many times previous to I could get it to load properly.
I had been wondering if your hosting is OK? Not that I
am complaining, but sluggish loading instances times will very frequently affect your placement in google and can damage
your quality score if ads and marketing with
Adwords. Well I&#39;m adding this RSS to my e-mail and could look out for much more of your respective fascinating content.

Ensure that you update this again soon.

_ plenty of fish dating site of free dating ― 2016年12月27日 21:52

Hi there, all is going nicely here and ofcourse every one is sharing facts, that&#39;s genuinely excellent, keep
up writing.

_ free dating sites no fees ― 2017年01月06日 10:42

Hello there, You&#39;ve done an incredible job. I&#39;ll definitely digg it and
personally recommend to my friends. I am sure they&#39;ll be benefited from this web site.

_ free dating sites no fees ― 2017年01月07日 06:45

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

_ free dating sites 2017 ― 2017年01月07日 21:45

Thank you for the auspicious writeup. It in fact was a amusement account it.
Look advanced to more added agreeable from you!

By the way, how could we communicate?

_ free dating sites for women ― 2017年01月08日 16:33

Yes! Finally someone writes about best free dating sites no fees.

_ cheap quest bars toronto ― 2017年01月10日 09:28

Greate article. Keep writing such kind of info on your blog.
Im really impressed by it.
Hello there, You&#39;ve done a fantastic job. I will certainly digg it
and personally suggest to my friends. I&#39;m sure they&#39;ll be
benefited from this site.

_ gamefly free trial ― 2017年01月10日 23:18

whoah this weblog is wonderful i really like studying your articles.
Keep up the great work! You know, a lot of people are
hunting around for this information, you could aid them greatly.

_ www.krogerfeedback.com ― 2017年01月13日 06:41

I am not sure where you&#39;re getting your information, but good topic.
I needs to spend some time learning more or understanding more.

Thanks for great info I was looking for this information for my mission.

_ www.krogerfeedback.com ― 2017年01月13日 23:54

I do believe all the concepts you&#39;ve introduced for your post.
They are very convincing and can certainly work. Nonetheless, the posts are very short for starters.
May just you please prolong them a little from subsequent time?

Thanks for the post.

_ www.krogerfeedback.com ― 2017年01月14日 14:42

Hey, I think your site might be having browser compatibility issues.
When I look at your website in Safari, it looks fine but when opening in Internet Explorer,
it has some overlapping. I just wanted to give you
a quick heads up! Other then that, amazing blog!

_ www.krogerfeedback.com ― 2017年01月15日 09:53

You made some really good points there. I checked on the internet for more info about
the issue and found most people will go along with your views on this web site.

_ www.krogerfeedback.com ― 2017年01月21日 04:49

These are genuinely great ideas in concerning blogging. You have
touched some pleasant things here. Any way keep up wrinting.

_ www.krogerfeedback.com ― 2017年01月21日 16:22

Hi there! This blog post could not be written much better!
Looking through this post reminds me of my previous roommate!
He always kept preaching about this. I will send this post
to him. Pretty sure he&#39;s going to have a good read.
Thank you for sharing!

_ I like the www.krogerfeedback.com homepage ― 2017年01月26日 10:31

Hey there! I know this is kind of off topic but I was wondering which blog platform are you
using for this website? I&#39;m getting fed up of Wordpress because I&#39;ve had problems with hackers and I&#39;m
looking at alternatives for another platform. I would be fantastic
if you could point me in the direction of a good platform.

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

トラックバック

このエントリのトラックバックURL: http://kida.asablo.jp/blog/2016/01/23/7998960/tb