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