文書整形 -- 指令の解析 ― 2016年12月05日 21:03
指令の解析は容易であり、comtyp()で行う。メインルーチンから呼び出される comand()から、最初にcomtyp()が呼び出される。comand()は、comtyp()の返す値に従い、 必要な処理を行っていく。comand()は以下の通りである。
RATFORでは、
# comand.r4 -- perform formatting command subroutine comand( buf ) character buf(MAXLINE) integer comtyp, getval integer ct, spval, val integer argtyp include cpage.ri include cparam.ri ct = comtyp(buf) if (ct == UNKOWN) # igore unknown commands return val = getval(buf,argtyp) if (ct == FI) { call brk fill = YES } else if (ct == NF) { call brk fill = NOC } else if (ct == BR) call brk else if (ct == LS) call set(lsval,val,argtyp,1,1,HUGE) else if (ct == HE) call gettl(buf,header) else if (ct == FO) call gettl(buf,footer) else if (ct == SP) { call set(spval,val,argtyp,1,0,HUGE) call space(spval) } else if (ct == BP) { if (lineno > 0) call space(HUGE) call set(curpage,val,argtyp,curpage+1,-HUGE,HUGE) newpag = curpag } else if (ct == PL) { call set(plval,val,argtyp,PAGELEN,m1val+m2val+m3val+m4val+1,HUGE) bottom = plval - m3val - m4val } else if (ct == IN) { call set(inval,val,argtyp,0,0,rmval-1) tival = inval } else if (ct == RM) call set(rmval,val,argtyp,PAGEWIDTH,tival+1,HUDGE) else if (ct == TI) { call brk call set(tival,val,argtyp,0,0,rmval-1) } else if (ct == CE) { call brk call set(ceval,val,argtyp,1,0,HUGE) } else if (ct .eq. 14) then ! UL(14) call set(ulval,val,argtyp,1,0,HUGE) return end
WATCOM fortran 77では、
c comand.f -- perform formatting command subroutine comand( buf ) integer*1 buf(82) ! MAXLINE(82) integer comtyp, getval integer ct, spval, val integer*1 argtyp include cpage.fi include cparam.fi ct = comtyp(buf) if (ct .eq. 0) then ! UNKOWN(0) return end if val = getval(buf,argtyp) if (ct .eq. 4) then ! FI(4) call brk fill = 1 ! YES(1) else if (ct .eq. 9) then ! NF(9) call brk fill = 0 ! NOC(0) else if (ct .eq. 2) then ! BR(2) call brk else if (ct .eq. 8) then ! LS(8) call set(lsval,val,argtyp,1,1,1000) ! HUGE(1000) else if (ct .eq. 6) then ! HE(6) call gettl(buf,header) else if (ct .eq. 5) then ! FO(5) call gettl(buf,footer) else if (ct .eq. 12) then ! SP(12) call set(spval,val,argtyp,1,0,1000) ! HUGE(1000) call space(spval) else if (ct .eq. 1) then ! BP(1) if (lineno .gt. 0) then call space(1000) ! HUGE(1000) end if call set(curpage,val,argtyp,curpage+1,-1000,1000) ! HUGE(1000) newpag = curpag else if (ct .eq. 10) then ! PL(10) call set(plval,val,argtyp,66, ! PAGELEN(66) 1 m1val+m2val+m3val+m4val+1,1000) ! HUGE(1000) bottom = plval - m3val - m4val else if (ct .eq. 7) then ! IN(7) call set(inval,val,argtyp,0,0,rmval-1) tival = inval else if (ct .eq. 11) then ! RM(11) call set(rmval,val,argtyp,60,tival+1,1000) ! PAGEWIDTH(60) HUGE(1000) else if (ct .eq. 13) then ! TI(13) call brk call set(tival,val,argtyp,0,0,rmval-1) else if (ct .eq. 3) then ! CE(3) call brk call set(ceval,val,argtyp,1,0,1000) ! HUGE(1000) else if (ct .eq. 14) then ! UL(14) call set(ulval,val,argtyp,1,0,1000) ! HUGE(1000) end if return end
実際の指令の解析は、comtyp()が行う。
RATFOR版は、以下の通り。
c comtyp.r4 -- decode command type integer function comtyp(buf) character buf(MAXLINE) if (buf(2) == LETB & buf(3) == LETP) comtyp = BP else if (buf(2) == LETB & buf(3) == LETR) comtyp = BR else if (buf(2) == LETC & buf(3) == LETE) comtyp = CE else if (buf(2) == LETF & buf(3) == LETI) comtyp = FI else if (buf(2) == LETF & buf(3) == LETO) comtyp = FO else if (buf(2) == LETH & buf(3) == LETE) comtyp = HE else if (buf(2) == LETI & buf(3) == LETN) comtyp = IN else if (buf(2) == LETL & buf(3) == LETS) comtyp = LS else if (buf(2) == LETN & buf(3) == LETF) comtyp = NF else if (buf(2) == LETP & buf(3) == LETL) comtyp = PL else if (buf(2) == LETR & buf(3) == LETM) comtyp = RM else if (buf(2) == LETS & buf(3) == LETP) comtyp = SP else if (buf(2) == LETT & buf(3) == LETI) comtyp = TI else if (buf(2) == LETU & buf(3) == LETL) comtyp = UL else comtyp = UNKOWN end if return end
WATCOM fortran77版は、以下の通り。
c comtyp.for -- decode command type integer function comtyp(buf) integer*1 buf(82) ! MAXLINE(82) if ((buf(2) .eq. 98) .and. (buf(3) .eq. 112)) then ! LETB('b',98) LETP('p',112) comtyp = 1 ! BP(1) else if ((buf(2) .eq. 98) .and. (buf(3) .eq. 114)) then ! LETB('b',98) LETR('r',114) comtyp = 2 ! BR(2) else if ((buf(2) .eq. 99) .and. (buf(3) .eq. 101)) then ! LETC('c',99) LETE('r',101) comtyp = 3 ! CE(3) else if ((buf(2) .eq. 102) .and. (buf(3) .eq. 105)) then ! LETF('f',102) LETI('i',105) comtyp = 4 ! FI(4) else if ((buf(2) .eq. 102) .and. (buf(3) .eq. 111)) then ! LETF('f',102) LETO('o',111) comtyp = 5 ! FO(5) else if ((buf(2) .eq. 104) .and. (buf(3) .eq. 101)) then ! LETH('h',104) LETE('e',101) comtyp = 6 ! HE(6) else if ((buf(2) .eq. 105) .and. (buf(3) .eq. 110)) then ! LETI('i',105) LETN('n',110) comtyp = 7 ! IN(7) else if ((buf(2) .eq. 108) .and. (buf(3) .eq. 115)) then ! LETL('l',108) LETS('n',115) comtyp = 8 ! LS(8) else if ((buf(2) .eq. 110) .and. (buf(3) .eq. 102)) then ! LETN('n',110) LETF('f',102) comtyp = 9 ! NF(9) else if ((buf(2) .eq. 112) .and. (buf(3) .eq. 108)) then ! LETP('n',112) LETL('l',108) comtyp = 10 ! PL(10) else if ((buf(2) .eq. 114) .and. (buf(3) .eq. 109)) then ! LETR('r',114) LETM('m',109) comtyp = 11 ! RM(11) else if ((buf(2) .eq. 115) .and. (buf(3) .eq. 112)) then ! LETS('s',115) LETP('p',112) comtyp = 12 ! SP(12) else if ((buf(2) .eq. 116) .and. (buf(3) .eq. 105)) then ! LETT('t',116) LETI('i',105) comtyp = 13 ! TI(13) else if ((buf(2) .eq. 117) .and. (buf(3) .eq. 108)) then ! LETU('u',117) LETL('l',108) comtyp = 14 ! UL(14) else comtyp = 0 ! UNKOWN(0) end if return end
指令の引数は、getval()で取得する。取得した値は、set()で設定する。
getval()のRATFOR版は、以下の通り。
# getval.r4 - evaluate optional numeric argument integer function getval(buf,argtyp) character buf(MAXLINE) integer ctoi integer argtyp, i i = 1 # skip command name while (buf(i) != BLANK & buf(i) != TAB & buf(i) != NEWLINW) i = i + 1 call skipbl(buf,i) # find argument argtyp = buf(i) if (argtyp == PLUS | argtyp == MINUS) i = i + 1 getval = ctoi(buf,i) return end
WATCOM fortran版は、以下の通り。
c getval.for - evaluate optional numeric argument integer function getval(buf,argtyp) integer*1 buf(82) ! MAXLINE(82) integer ctoi integer argtyp, i i = 1 ! skip command name while ((buf(i) .ne. 32) ! BLANK(32) 1 .and. (buf(i) .ne. 9) ! TAB(9) 2 .and. (buf(i) .ne. 10)) do ! NEWLINE(10) i = i + 1 end while call skipbl(buf,i) ! find argument argtyp = buf(i) if ((argtyp .eq. 43) .or. (argtyp .eq. 45)) then ! PLUS('+',43) MINUS('-',45) i = i + 1 end if getval = ctoi(buf,i) return end
set()のRATFOR版は、以下の通り。
# set.r4 -- set parameter and check range subroutine set( param, val, argtyp, defval, minval, maxval ) integer param, val, defval, minval, maxval character argtyp integer max,min if (argtyp == NEWLINE) param = defval else if (argtyp == PLUS) param = param + val else if (argtyp == MINUS) param = param - val else param = val param = min( param, maxval ) param = max( param, minval ) return end
WATCOM fortran版は、以下の通り。
c set.for -- set parameter and check range subroutine set( param, val, argtyp, defval, minval, maxval ) integer param, val, defval, minval, maxval integer*1 argtyp integer max,min if (argtyp .eq. 10) then ! defaulted NEWLINE(10) param = defval else if (argtyp .eq. 43) then ! relative + PLUS('+',43) param = param + val else if (argtyp .eq. 45) then ! relative - NIMUS('-',45) param = param - val else param = val endif param = min( param, maxval ) param = max( param, minval ) return end
コメント
_ tinder dating ― 2017年02月25日 23:21
Pretty! This was an extremely wonderful post. Many thanks for providing these details.
_ tinder dating site ― 2017年02月26日 04:44
My partner and I absolutely love your blog and find nearly
all of your post's to be exactly what I'm looking for.
Would you offer guest writers to write content in your
case? I wouldn't mind producing a post or elaborating on many of the subjects you write concerning here.
Again, awesome website!
all of your post's to be exactly what I'm looking for.
Would you offer guest writers to write content in your
case? I wouldn't mind producing a post or elaborating on many of the subjects you write concerning here.
Again, awesome website!
_ tinder dating site ― 2017年03月01日 03:52
It's a pity you don't have a donate button!
I'd without a doubt donate to this outstanding blog! I guess for now i'll settle for
bookmarking and adding your RSS feed to my Google account.
I look forward to brand new updates and will share this site with my Facebook group.
Talk soon!
I'd without a doubt donate to this outstanding blog! I guess for now i'll settle for
bookmarking and adding your RSS feed to my Google account.
I look forward to brand new updates and will share this site with my Facebook group.
Talk soon!
_ tinder dating site ― 2017年03月02日 15:28
Thanks for your marvelous posting! I seriously enjoyed reading it, you could be a great author.I will
be sure to bookmark your blog and will eventually come back in the foreseeable future.
I want to encourage yourself to continue your great writing, have a nice morning!
be sure to bookmark your blog and will eventually come back in the foreseeable future.
I want to encourage yourself to continue your great writing, have a nice morning!
_ minecraft ― 2017年03月03日 10:18
Right here is the perfect web site for everyone who would like to find out about this topic.
You know a whole lot its almost hard to argue with
you (not that I actually would want to…HaHa). You certainly put a
new spin on a topic which has been written about for years.
Excellent stuff, just excellent!
You know a whole lot its almost hard to argue with
you (not that I actually would want to…HaHa). You certainly put a
new spin on a topic which has been written about for years.
Excellent stuff, just excellent!
_ tinder dating site ― 2017年03月05日 03:58
Hello superb blog! Does running a blog such as this require a massive amount work?
I've virtually no understanding of coding however
I had been hoping to start my own blog in the near
future. Anyway, if you have any recommendations or tips for new blog owners please share.
I understand this is off topic but I simply needed to ask.
Kudos!
I've virtually no understanding of coding however
I had been hoping to start my own blog in the near
future. Anyway, if you have any recommendations or tips for new blog owners please share.
I understand this is off topic but I simply needed to ask.
Kudos!
_ tinder dating site ― 2017年03月05日 13:12
Appreciation to my father who shared with me about this
weblog, this web site is actually remarkable.
weblog, this web site is actually remarkable.
_ minecraft ― 2017年03月07日 15:49
Hi there, just became aware of your blog through Google, and found that
it's really informative. I'm going to watch out for brussels.
I'll be grateful if you continue this in future. Numerous people
will be benefited from your writing. Cheers!
it's really informative. I'm going to watch out for brussels.
I'll be grateful if you continue this in future. Numerous people
will be benefited from your writing. Cheers!
_ Torrance California Online Dating ― 2017年03月07日 23:53
Very nice post. I just stumbled upon your blog
and wished to say that I have really enjoyed surfing around
your weblog posts. After all I will be subscribing for your feed
and I'm hoping you write again soon!
and wished to say that I have really enjoyed surfing around
your weblog posts. After all I will be subscribing for your feed
and I'm hoping you write again soon!
_ manicure ― 2017年03月09日 16:52
Someone necessarily lend a hand to make significantly posts I'd state.
This is the first time I frequented your website page and to
this point? I amazed with the research you made to create this particular put
up extraordinary. Great process!
This is the first time I frequented your website page and to
this point? I amazed with the research you made to create this particular put
up extraordinary. Great process!
_ sanclemente.mrdrain.com ― 2017年03月10日 04:26
Hello There. I discovered your weblog the usage of
msn. That is a really well written article. I'll be
sure to bookmark it and return to read extra of your helpful information.
Thank you for the post. I will certainly return.
msn. That is a really well written article. I'll be
sure to bookmark it and return to read extra of your helpful information.
Thank you for the post. I will certainly return.
_ tinyurl.com ― 2017年03月11日 03:44
Why users still make use of to read news papers when in this technological world the whole thing is presented on web?
_ tinyurl.com ― 2017年03月11日 21:46
Incredible points. Great arguments. Keep up the good spirit.
_ tinyurl.com ― 2017年03月12日 02:21
Hey! Do you use Twitter? I'd like to follow you if that would be
okay. I'm absolutely enjoying your blog and look forward to new posts.
okay. I'm absolutely enjoying your blog and look forward to new posts.
_ binged.it ― 2017年03月12日 04:42
I know this website gives quality dependent posts and extra material,
is there any other web site which offers such information in quality?
is there any other web site which offers such information in quality?
_ tinder dating site ― 2017年03月13日 15:28
Hello there, There's no doubt that your website could possibly be having web browser compatibility issues.
When I take a look at your web site in Safari, it looks fine
however, when opening in IE, it's got some overlapping issues.
I simply wanted to give you a quick heads up! Other than that, wonderful site!
When I take a look at your web site in Safari, it looks fine
however, when opening in IE, it's got some overlapping issues.
I simply wanted to give you a quick heads up! Other than that, wonderful site!
_ tinder dating site ― 2017年03月14日 13:44
Excellent post. I am experiencing many of these issues as well..
_ tinder dating site ― 2017年03月15日 10:44
Hello There. I found your blog using msn. This is a very well written article.
I will make sure to bookmark it and return to read more of your useful information. Thanks
for the post. I will definitely return.
I will make sure to bookmark it and return to read more of your useful information. Thanks
for the post. I will definitely return.
_ tinder dating site ― 2017年03月18日 13:40
I always used to read piece of writing in news papers but now as I am a user of web thus from now I am using
net for posts, thanks to web.
net for posts, thanks to web.
_ tinder dating site ― 2017年03月19日 01:59
There's definately a lot to learn about this topic. I like all the points you
have made.
have made.
_ tinder dating site ― 2017年03月20日 07:13
Do you have any video of that? I'd love
to find out more details.
to find out more details.
_ free dating no fee ― 2017年03月22日 00:05
I like it whenever people come together and share
ideas. Great site, stick with it!
ideas. Great site, stick with it!
_ free dating sites no fees ― 2017年03月22日 00:07
You really make it seem so easy with your presentation but I find this matter
to be actually something which I think I would never understand.
It seems too complex and extremely broad for me.
I am looking forward for your next post, I'll try to get the hang of it!
to be actually something which I think I would never understand.
It seems too complex and extremely broad for me.
I am looking forward for your next post, I'll try to get the hang of it!
_ free dating sites no fees ― 2017年03月22日 05:43
This web site certainly has all of the information I needed concerning this subject and didn't know who to ask.
_ free dating sites no fees ― 2017年03月23日 08:15
When someone writes an paragraph he/she keeps the thought of a user in his/her brain that how a user can understand it.
Thus that's why this piece of writing is outstdanding.
Thanks!
Thus that's why this piece of writing is outstdanding.
Thanks!
_ free dating sites no fees ― 2017年03月23日 10:28
Wonderful blog! I found it while surfing around
on Yahoo News. Do you have any tips on how to get listed in Yahoo News?
I've been trying for a while but I never seem to get there!
Cheers
on Yahoo News. Do you have any tips on how to get listed in Yahoo News?
I've been trying for a while but I never seem to get there!
Cheers
_ free dating sites no fees ― 2017年03月23日 10:43
Yesterday, while I was at work, my sister stole my iphone and tested
to see if it can survive a forty foot drop, just so she can be a youtube sensation. My apple
ipad is now broken and she has 83 views. I know this is
entirely off topic but I had to share it with someone!
to see if it can survive a forty foot drop, just so she can be a youtube sensation. My apple
ipad is now broken and she has 83 views. I know this is
entirely off topic but I had to share it with someone!
_ minecraft demo ― 2017年03月26日 01:40
Hmm is anyone else encountering problems with the images on this blog loading?
I'm trying to find out if its a problem on my end or if it's the blog.
Any suggestions would be greatly appreciated.
I'm trying to find out if its a problem on my end or if it's the blog.
Any suggestions would be greatly appreciated.
_ minecraft free download ― 2017年03月27日 02:20
Hello there, just became alert to your blog through
Google, and found that it is truly informative. I am
gonna watch out for brussels. I will be grateful if you continue this in future.
Numerous people will be benefited from your writing.
Cheers!
Google, and found that it is truly informative. I am
gonna watch out for brussels. I will be grateful if you continue this in future.
Numerous people will be benefited from your writing.
Cheers!
_ manicure ― 2017年03月30日 19:59
We stumbled over here from a different web address and thought I
might check things out. I like what I see so i am just following you.
Look forward to looking over your web page again.
might check things out. I like what I see so i am just following you.
Look forward to looking over your web page again.
_ manicure ― 2017年03月30日 20:02
Heya this is kind of of off topic but I was wanting
to know if blogs use WYSIWYG editors or if you have to manually code with HTML.
I'm starting a blog soon but have no coding experience so I wanted to get guidance from someone with experience.
Any help would be enormously appreciated!
to know if blogs use WYSIWYG editors or if you have to manually code with HTML.
I'm starting a blog soon but have no coding experience so I wanted to get guidance from someone with experience.
Any help would be enormously appreciated!
_ manicure ― 2017年03月30日 20:03
Hey! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche.
Your blog provided us beneficial information to work on. You have done a wonderful job!
Your blog provided us beneficial information to work on. You have done a wonderful job!
_ manicure ― 2017年03月30日 20:19
Asking questions are genuinely fastidious thing if you are not understanding something completely, except
this paragraph provides fastidious understanding even.
this paragraph provides fastidious understanding even.
_ manicure ― 2017年04月03日 11:37
When some one searches for his necessary thing, therefore
he/she wants to be available that in detail, thus that thing is maintained over here.
he/she wants to be available that in detail, thus that thing is maintained over here.
_ BHW ― 2017年04月16日 12:14
Do you mind if I quote a couple of your posts as long as I provide credit and sources back to your website?
My website is in the very same area of interest as yours and my visitors would genuinely benefit
from a lot of the information you present here. Please let me know if this okay with you.
Thanks a lot!
My website is in the very same area of interest as yours and my visitors would genuinely benefit
from a lot of the information you present here. Please let me know if this okay with you.
Thanks a lot!
_ www.krogerfeedback.com ― 2017年04月29日 13:26
It's really a nice and helpful piece of info.
I am glad that you just shared this useful info with
us. Please keep us up to date like this. Thank you for sharing.
I am glad that you just shared this useful info with
us. Please keep us up to date like this. Thank you for sharing.
_ www.krogerfeedback.com ― 2017年05月01日 12:49
Amazing! This blog looks just like my old one! It's on a completely different subject
but it has pretty much the same layout and design. Outstanding choice of colors!
but it has pretty much the same layout and design. Outstanding choice of colors!
_ manicure ― 2017年05月03日 16:12
I really like your blog.. very nice colors & theme.
Did you design this website yourself or did you hire someone to do
it for you? Plz answer back as I'm looking to construct my own blog and would like to know where u got this from.
cheers
Did you design this website yourself or did you hire someone to do
it for you? Plz answer back as I'm looking to construct my own blog and would like to know where u got this from.
cheers
_ Minecraft ― 2017年05月19日 21:06
Hi my family member! I wish to say that this
article is amazing, great written and come with approximately
all vital infos. I'd like to look extra posts
like this .
article is amazing, great written and come with approximately
all vital infos. I'd like to look extra posts
like this .
_ Minecraft ― 2017年05月19日 23:39
We stumbled over here coming from a different page
and thought I may as well check things out. I like what I see so i am just following you.
Look forward to looking into your web page repeatedly.
and thought I may as well check things out. I like what I see so i am just following you.
Look forward to looking into your web page repeatedly.
_ Minecraft ― 2017年05月20日 07:46
Saved as a favorite, I love your website!
_ minecraft maps for pe ― 2017年05月22日 14:18
Hmm is anyone else experiencing problems with the images on this blog loading?
I'm trying to find out if its a problem on my end or if it's the blog.
Any suggestions would be greatly appreciated.
I'm trying to find out if its a problem on my end or if it's the blog.
Any suggestions would be greatly appreciated.
_ instacart promo code august 2017 ― 2017年08月20日 23:15
I'm gone to say to my little brother, that he should also pay a quick
visit this webpage on regular basis to get updated
from hottest news update.
visit this webpage on regular basis to get updated
from hottest news update.
_ tinyurl.com ― 2017年08月21日 17:24
Wow, this article is fastidious, my sister is analyzing these kinds of things, therefore I am going to let
know her.
know her.
_ instacart coupon ― 2017年08月21日 22:43
Hello there! I know this is kinda off topic
nevertheless I'd figured I'd ask. Would you be interested in trading links or maybe guest authoring a blog article or vice-versa?
My site covers a lot of the same subjects as yours and
I believe we could greatly benefit from each other. If you might be
interested feel free to send me an email. I look forward to hearing from you!
Fantastic blog by the way!
nevertheless I'd figured I'd ask. Would you be interested in trading links or maybe guest authoring a blog article or vice-versa?
My site covers a lot of the same subjects as yours and
I believe we could greatly benefit from each other. If you might be
interested feel free to send me an email. I look forward to hearing from you!
Fantastic blog by the way!
_ http://tinyurl.com/ybrxa6ru ― 2017年08月22日 04:19
It's very trouble-free to find out any topic on net as compared
to textbooks, as I found this piece of writing at this web site.
to textbooks, as I found this piece of writing at this web site.
_ http://tinyurl.com/ ― 2017年08月24日 16:01
You really make it seem so easy with your presentation but I find this matter to
be actually something that I think I would never understand.
It seems too complicated and extremely broad for me.
I'm looking forward for your next post, I'll try to get the
hang of it!
be actually something that I think I would never understand.
It seems too complicated and extremely broad for me.
I'm looking forward for your next post, I'll try to get the
hang of it!
_ tinyurl.com ― 2017年08月24日 17:41
Thank you for the good writeup. It in fact was a amusement account it.
Look advanced to far added agreeable from you! However, how can we
communicate?
Look advanced to far added agreeable from you! However, how can we
communicate?
_ http://tinyurl.com ― 2017年08月25日 07:31
Good replies in return of this query with real arguments and describing the whole
thing about that.
thing about that.
_ tinyurl.com ― 2017年08月25日 14:13
This is my first time pay a quick visit at here and i am really impressed to read all
at single place.
at single place.
※コメントの受付件数を超えているため、この記事にコメントすることができません。
トラックバック
このエントリのトラックバックURL: http://kida.asablo.jp/blog/2016/12/05/8268753/tb
最近のコメント