首页 > 其他 > 详细

一个简单的安全数据挖掘语言产生式

时间:2014-04-07 00:35:21      阅读:314      评论:0      收藏:0      [点我收藏+]

program::=[include_list]|decl_list

include_list::={”@include ”ID”;”}

decl_list::={ decl}

decl::=var_decl|function_decl

var_decl::=type ID";"|type @ID ";"

type::="numeric”|"string"|user_define_type

user_define_type::="struct" ID "{"type ID[{“,”type ID}]]"};"

function_decl::=type "sub" ID(params)"{"stmt"}"

params::=param[{”,”param}]|""

param::=type ID|type@ID

stmt::=assignment_stmt|if_stmt|iteration_stmt|expression";"|”goto”ID|ID ”:” stmt|stmt

assignment_stmt::=ID"="constant|ID|expression";"

if_stmt::="if" "(" expression")" "{"stmt"}"|"if" "("expression ")" "{"stmt"}" "else""{"stmt"}"

iteration_stmt::="while" "("expression ")" "{"stmt|continue_stmt|break_stmt"}"

continue_stmt::=”continue;”

break_stmt::=”break;”

expression::={simple_expression}

simple_expression::=additive_expression relopadditive_expression

relop::="<="|"<"|">"|">="|"=="|"!="|"&&"|"||"|”=~”|”!~”

additive_expression::=additive_expression addop term

addop::="+"|"-"

term::=term mulop factor|factor

mulop::="*"|"/"|"%"

factor::=expression|ID|ID”[“expression”]”|function_call|constant

function_call::=ID(args)

args::=arg_list|""

arg_list::=arg_list,expression|expression

对于上述产生式而言,有如下几点需要说明:

1.@include表示包含其它信息安全数据挖掘程序文件;

2.ID其实就是文件、函数或变量名称,而@ID则是数组变量(或称之为向量);

3.=~!~运算符分别表示正则匹配或不匹配;

constant表示数值型常量或字符串常量,这里约定字符串常量必须用双引号括起,如字符串中出现双引号则必须使用“\”进行转义。


一个简单的安全数据挖掘语言产生式,布布扣,bubuko.com

一个简单的安全数据挖掘语言产生式

原文:http://6623698.blog.51cto.com/6613698/1391341

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!