惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Archives - TechRepublic
Security Archives - TechRepublic
O
OpenAI News
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
H
Heimdal Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Palo Alto Networks Blog
Project Zero
Project Zero
Attack and Defense Labs
Attack and Defense Labs
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Tor Project blog
Scott Helme
Scott Helme
T
Threat Research - Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
Spread Privacy
Spread Privacy
Cisco Talos Blog
Cisco Talos Blog
T
Threatpost
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
Google DeepMind News
Google DeepMind News
P
Privacy & Cybersecurity Law Blog
Know Your Adversary
Know Your Adversary
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
L
Lohrmann on Cybersecurity
Cloudbric
Cloudbric
I
Intezer
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
AI
AI
B
Blog
S
Securelist
P
Proofpoint News Feed
量子位
Jina AI
Jina AI
V2EX - 技术
V2EX - 技术
T
The Exploit Database - CXSecurity.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
CERT Recently Published Vulnerability Notes
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

博客园 - 未未

用vsstudio 设计Winform 高分屏上布局错乱的问题 探寻路径 jsonToxml 通过LL型方法实现(C#)[源] 数据类型和Json格式[zt] 繁星代码生成器开源 (源代码) 繁星查询分析器 代码生成器 架构提取工具-tqdemo SyCODE Syntax Highlighter javascript语法高亮引擎 自动代码生成和VBA脚本 代码生成工具的分类及比较 繁星代码生成器0.91版 【视频】 0.9版-繁星代码生成器 转:C#开源资源大汇总 代码生成原则Top10 我的系分之路 你必须知道的10种国产编程语言 揭秘正则表达式 我的lxfRegex现实[源] 有关调试的方法 [源码]C# to SQL 的翻译器.net 1.1版
模板语法规则说明
未未 · 2009-05-14 · via 博客园 - 未未

繁星代码生成器

模板语法说明:

1.嵌入标记 {% ... %} 类似与 asp <% ... %> 或是php <? ?>

 {% 为模板语言的开始标记, %} 为模板语言的结束标记,中间书写语句

一条语句在一个{% ... %}中。

自动对齐标记 :{%上加一个% 为自动对齐

 {%%  自动对齐前一个非空白字符上

 %%} 自动对齐到后一个非空白字符上

: 注意黑体字的位置.

项目的命名空间是 {%=NAMESPACE%}   . 环境变量是

输出: 项目的命名空间是 MultiStar   . 环境变量是

项目的命名空间是 {%%=NAMESPACE%%}   . 环境变量是

输出: 项目的命名空间是MultiStar. 环境变量是

2. 输出语句

{%= 变量 %} 对变量名进行输出。参考上例。

3. 分支条件

if

{%if 条件表达式%} ..... {%end if%}

when

{%when%}

{%case "条件表达式1"%} .... {%end case%}

{%case "条件表达式2"%} .... {%end case%}

{%case "条件表达式3"%} .... {%end case%}

...

{%else%} ... {%end else%}

{%end when%}

4. 循环

{%foreach 可循环变量%}

...

{%end foreach%}

5. 函数

定义方式

{% function DoSomething(变量体)%}

...

{%end function%}

调用方式

{%call DoSomething(变量体)%}

注意: 函数要选调用,后声明,声明之后,不能写任何模板代码

6. 注释

{%-- .... --%}注释的部分

7. 系统内部函数和变量

{%=$splite( ,)%}: 表示在循环中输出间隔符号 “,”

{%=$pos()%} 表示 position() -1 当前的位置 postion()

{%=$count(Fields.Field)%} 计算变量Fields.Field的个数。

{%=NAMESPACE%} 表示命名空间的变量。

8. 预定义

{%define column%}

当用到 {%=%},自动翻译为 {%=column%}   

示例1:

--生成查询

       SELECT {%foreach Fields/Field%}{%=Name%}{%=$split (,)%}

                          {%%end foreach%} from {%=Name%}

输出:

SELECT User_Code,User_Name,Password,User_Level,Department,Remark,Create_Date,IsValid FROM T_USER WHERE User_Code=@User_Code

示例2:

--根据主键删除

       Delete FROM {%=Name%} WHERE {%foreach Keys/Key%}

        {%%=Name%}=@

        {%%=Name%}{%=$split (AND)%}{%end foreach%}

输出:

Delete FROM T_USER WHERE User_Code=@User_Code