INSTALL @lib$+"XMLLIB"
url$ = "http://feeds.bbc.co.uk/weather/feeds/rss/5day/id/2688.xml"
XMLfile$ = @tmp$+"temp.xml"
PROCurldownload(url$, XMLfile$)
PROC_initXML(xml{}, XMLfile$)
rss% = FN_skipTo(xml{}, "rss", 0)
IF rss% THEN
channel% = FN_skipTo(xml{}, "channel", rss%)
IF channel% THEN
IF FN_skipTo(xml{}, "title", channel%) THEN
PRINT FN_repEnt(FN_nextToken(xml{}))
ENDIF
WHILE FN_skipTo(xml{}, "item", channel%)
item% = FN_getLevel(xml{})
IF FN_skipTo(xml{}, "title", item%) THEN
PRINT 'FN_repEnt(FN_nextToken(xml{}))
ENDIF
ENDWHILE
ENDIF
ENDIF
PROC_exitXML(xml{})
END
徽标:
FD 20 ; drawing a line and moving
PENUP ; lifting the pen so it will not draw anything
FD 20 ; moving but not drawing
PENDOWN ; lowering the pen so it draws again
FD 20 ; drawing a line and moving
PENUP ; lifting the pen so it will not draw anything
FD 40 ; moving but not drawing
PENDOWN ; lowering the pen so it draws again
RT 20 ; rotating right (clockwise) 20 degrees
Scratch:
您确实需要查看可视化编辑器
Assuming that you've looked into other pre-existing languages and found them wanting... OK, I'm sorry, but you're leaping into a seriously complicated subject by wanting to design your own language. Well defined (and supported) languages such as Logo, BBC BASIC (a personal favourite of mine) and (my 3 year old loves this) Scratch are all very simple to pick up.
INSTALL @lib$+"XMLLIB"
url$ = "http://feeds.bbc.co.uk/weather/feeds/rss/5day/id/2688.xml"
XMLfile$ = @tmp$+"temp.xml"
PROCurldownload(url$, XMLfile$)
PROC_initXML(xml{}, XMLfile$)
rss% = FN_skipTo(xml{}, "rss", 0)
IF rss% THEN
channel% = FN_skipTo(xml{}, "channel", rss%)
IF channel% THEN
IF FN_skipTo(xml{}, "title", channel%) THEN
PRINT FN_repEnt(FN_nextToken(xml{}))
ENDIF
WHILE FN_skipTo(xml{}, "item", channel%)
item% = FN_getLevel(xml{})
IF FN_skipTo(xml{}, "title", item%) THEN
PRINT 'FN_repEnt(FN_nextToken(xml{}))
ENDIF
ENDWHILE
ENDIF
ENDIF
PROC_exitXML(xml{})
END
Logo:
FD 20 ; drawing a line and moving
PENUP ; lifting the pen so it will not draw anything
FD 20 ; moving but not drawing
PENDOWN ; lowering the pen so it draws again
FD 20 ; drawing a line and moving
PENUP ; lifting the pen so it will not draw anything
FD 40 ; moving but not drawing
PENDOWN ; lowering the pen so it draws again
RT 20 ; rotating right (clockwise) 20 degrees
发布评论
评论(1)
假设您已经研究了其他预先存在的语言并发现它们想要...好吧,我很抱歉,但是您想要设计自己的语言,从而陷入了一个非常复杂的主题。定义良好(且受支持)的语言,例如 Logo、BBC BASIC (我个人最喜欢的)和(我 3 岁的孩子喜欢这个)Scratch 都很容易上手。
假设您要继续执行此操作,请查看域特定语言并还可以考虑购买同名书籍< /a>(无附属链接)由著名的 Martin Fowler 等人撰写。
编辑以包含语法示例:
BBC Basic RSS feed 阅读器
徽标:
Scratch:
您确实需要查看可视化编辑器
Assuming that you've looked into other pre-existing languages and found them wanting... OK, I'm sorry, but you're leaping into a seriously complicated subject by wanting to design your own language. Well defined (and supported) languages such as Logo, BBC BASIC (a personal favourite of mine) and (my 3 year old loves this) Scratch are all very simple to pick up.
Assuming you're going forward with this, then take a look at Domain Specific Languages and also consider purchasing the book of the same title (no affiliate link) by the renowned Martin Fowler et al.
Edited to include syntax examples:
BBC Basic RSS feed reader
Logo:
Scratch:
You need to see the visual editor really