/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

grammar HermitRule;

axioms : ( axiom | ruleN | dGAxiom )*;
ruleN : dLSafeRule | dGRule;
dLSafeRule : DL_SAFE_RULE '(' annotation* BODY '(' atom* ')'
HEAD '(' head ')' ')';

head: atom*;
axiom : declaration | classAxiom | objectPropertyAxiom | dataPropertyAxiom | datatypeDefinition | hasKey | assertion | annotationAxiom;
declaration: DECLARATION '(' axiomAnnotations entity ')';

entity: class_entity | data_type_entity | object_property_entity
| data_property_entity | annotation_property_entity | named_individual_entity;
class_entity:CLASS '(' classN ')';
data_type_entity:DATA_TYPE '(' datatype ')';
object_property_entity:OBJECT_PROPERTY '(' objectProperty ')';
data_property_entity:DATA_PROPERTY '(' dataProperty ')';
annotation_property_entity:ANNOTATION_PROPERTY '(' annotationProperty ')';
named_individual_entity:NAMED_INDIVIDUAL '(' namedIndividual ')';

classAxiom:subClassOf | equivalentClasses | disjointClasses | disjointUnion;
subClassOf:SUB_CLASS_OF '(' axiomAnnotations subClassExpression superClassExpression ')';
equivalentClasses:EQUIVALENT_CLASSES '(' axiomAnnotations classExpression classExpression classExpression* ')';
subClassExpression : classExpression;
superClassExpression:classExpression;
disjointClasses:DISJOINT_CLASSES '(' axiomAnnotations classExpression classExpression classExpression* ')';
disjointUnion:DISJOINT_UNION '(' axiomAnnotations classN disjointClassExpressions ')';
disjointClassExpressions:classExpression classExpression classExpression*;
objectPropertyAxiom:
subObjectPropertyOf | equivalentObjectProperties |
disjointObjectProperties | inverseObjectProperties |
objectPropertyDomain | objectPropertyRange |
functionalObjectProperty | inverseFunctionalObjectProperty |
reflexiveObjectProperty | irreflexiveObjectProperty |
symmetricObjectProperty | asymmetricObjectProperty |
transitiveObjectProperty;
subObjectPropertyOf:SUB_OBJECT_PROPERTY_OF '(' axiomAnnotations subObjectPropertyExpression superObjectPropertyExpression ')';
subObjectPropertyExpression:objectPropertyExpression | propertyExpressionChain;
propertyExpressionChain:OBJECT_PROPERTY_CHAIN '(' objectPropertyExpression objectPropertyExpression objectPropertyExpression* ')';
superObjectPropertyExpression:objectPropertyExpression;
equivalentObjectProperties:EQUIVALENT_OBJECT_PROPERTIES '(' axiomAnnotations objectPropertyExpression objectPropertyExpression objectPropertyExpression* ')';
disjointObjectProperties:DISJOINT_OBJECT_PROPERTIES '(' axiomAnnotations objectPropertyExpression objectPropertyExpression objectPropertyExpression* ')';

objectPropertyDomain : OBJECT_PROPERTY_DOMAIN '(' axiomAnnotations objectPropertyExpression classExpression ')';

objectPropertyRange : OBJECT_PROPERTY_RANGE '(' axiomAnnotations objectPropertyExpression classExpression ')';

inverseObjectProperties : INVERSE_OBJECT_PROPERTIES '(' axiomAnnotations objectPropertyExpression objectPropertyExpression ')';

functionalObjectProperty : FUNCTIONAL_OBJECT_PROPERTY '(' axiomAnnotations objectPropertyExpression ')';

inverseFunctionalObjectProperty : INVERSE_FUNCTIONAL_OBJECT_PROPERTY '(' axiomAnnotations objectPropertyExpression ')';

reflexiveObjectProperty : REFLEXIVE_OBJECT_PROPERTY '(' axiomAnnotations objectPropertyExpression ')';

irreflexiveObjectProperty : IRREFLEXIVE_OBJECT_PROPERTY '(' axiomAnnotations objectPropertyExpression ')';

symmetricObjectProperty : SYMMETRIC_OBJECT_PROPERTY '(' axiomAnnotations objectPropertyExpression ')';

asymmetricObjectProperty : ASYMMETRIC_OBJECT_PROPERTY '(' axiomAnnotations objectPropertyExpression ')';

transitiveObjectProperty : TRANSITIVE_OBJECT_PROPERTY '(' axiomAnnotations objectPropertyExpression ')';

dataPropertyAxiom :
subDataPropertyOf | equivalentDataProperties | disjointDataProperties |
dataPropertyDomain | dataPropertyRange | functionalDataProperty;

subDataPropertyOf : SUB_DATA_PROPERTY_OF '(' axiomAnnotations subDataPropertyExpression superDataPropertyExpression ')';
subDataPropertyExpression : dataPropertyExpression;
superDataPropertyExpression : dataPropertyExpression;

equivalentDataProperties : EQUIVALENT_DATA_PROPERTIES '(' axiomAnnotations dataPropertyExpression dataPropertyExpression dataPropertyExpression* ')';

disjointDataProperties : DISJOINT_DATA_PROPERTIES '(' axiomAnnotations dataPropertyExpression dataPropertyExpression dataPropertyExpression* ')';

dataPropertyDomain : DATA_PROPERTY_DOMAIN '(' axiomAnnotations dataPropertyExpression classExpression ')';

dataPropertyRange : DATA_PROPERTY_RANGE '(' axiomAnnotations dataPropertyExpression dataRange ')';

functionalDataProperty :FUNCTIONAL_DATA_PROPERTY '(' axiomAnnotations dataPropertyExpression ')';

datatypeDefinition : DATATYPE_DEFINITION '(' axiomAnnotations datatype dataRange ')';

hasKey : HAS_KEY '(' axiomAnnotations classExpression '(' objectPropertyExpression* ')' '(' dataPropertyExpression* ')' ')';

atom:
class_atom | data_range_atom | object_property_atom
| data_property_atom | built_in_atom | same_individual_atom
| different_individuals_atom
;
class_atom:CLASS_ATOM '(' classExpression iArg ')';
data_range_atom:DATA_RANGE_ATOM '(' dataRange dArg ')';
object_property_atom:OBJECT_PROPERTY_ATOM '(' objectPropertyExpression iArg iArg ')';
data_property_atom:DATA_PROPERTY_ATOM '(' dataProperty iArg dArg ')';
built_in_atom:BUILT_IN_ATOM '(' iRI dArg dArg* ')';
same_individual_atom:SAME_INDIVIDUAL_ATOM '(' iArg iArg ')';
different_individuals_atom:DIFFERENT_INDIVIDUALS_ATOM '(' iArg iArg')';

iArg : VARIABLE '(' iRI ')' | individual;
dArg : VARIABLE '(' iRI ')' | literal;
dGRule : DESCRIPTION_GRAPH_RULE '(' annotation* BODY '(' dGAtom* ')'
HEAD '(' headDGRule ')' ')';
headDGRule:dGAtom*;
dGAtom : CLASS_ATOM '(' classExpression iArg ')'
| OBJECT_PROPERTY_ATOM '(' objectPropertyExpression iArg iArg ')';
dGAxiom : DESCRIPTION_GRAPH '(' annotation* dGNodes
dGEdges mainClasses')';
dGNodes : NODES'(' nodeAssertion nodeAssertion* ')';
nodeAssertion : NODE_ASSERTION'(' classN dGNode ')';
dGNode : iRI;
dGEdges : EDGES'(' edgeAssertion edgeAssertion* ')';
edgeAssertion : EDGE_ASSERTION '(' objectProperty dGNode dGNode')';
mainClasses : MAIN_CLASSES '(' classN classN* ')';

annotationSubject : iRI | anonymousIndividual;
annotationValue : anonymousIndividual | iRI | literal;
axiomAnnotations : annotation*;

annotation : ANNOTATION '(' annotationAnnotations annotationProperty annotationValue ')';
annotationAnnotations : annotation*;
annotationProperty : iRI;
annotationAxiom : annotationAssertion | subAnnotationPropertyOf | annotationPropertyDomain | annotationPropertyRange;

annotationAssertion : ANNOTATION_ASSERTION '(' axiomAnnotations annotationProperty annotationSubject annotationValue ')';

subAnnotationPropertyOf : SUB_ANNOTATION_PROPERTY_OF '(' axiomAnnotations subAnnotationProperty superAnnotationProperty ')';
subAnnotationProperty : annotationProperty;
superAnnotationProperty : annotationProperty;

annotationPropertyDomain : ANNOTATION_PROPERTY_DOMAIN '(' axiomAnnotations annotationProperty iRI ')';

annotationPropertyRange : ANNOTATION_PROPERTY_RANGE '(' axiomAnnotations annotationProperty iRI ')' ;

classExpression: classN |
objectIntersectionOf | objectUnionOf | objectComplementOf | objectOneOf |
objectSomeValuesFrom | objectAllValuesFrom | objectHasValue | objectHasSelf |
objectMinCardinality | objectMaxCardinality | objectExactCardinality |
dataSomeValuesFrom | dataAllValuesFrom | dataHasValue |
dataMinCardinality | dataMaxCardinality | dataExactCardinality;

objectIntersectionOf : OBJECT_INTERSECTION_OF '(' classExpression classExpression classExpression* ')';

objectUnionOf : OBJECT_UNION_OF '(' classExpression classExpression classExpression* ')';

objectComplementOf : OBJECT_COMPLEMENT_OF '(' classExpression ')';

objectOneOf : OBJECT_ONE_OF '(' individual individual*')';

objectSomeValuesFrom : OBJECT_SOME_VALUES_FROM '(' objectPropertyExpression classExpression ')';

objectAllValuesFrom : OBJECT_ALL_VALUES_FROM '(' objectPropertyExpression classExpression ')';

objectHasValue : OBJECT_HAS_VALUE '(' objectPropertyExpression individual ')';

objectHasSelf : OBJECT_HAS_SELF '(' objectPropertyExpression ')';

objectMinCardinality : OBJECT_MIN_CARDINALITY '(' INTEGER objectPropertyExpression classExpression? ')';

objectMaxCardinality : OBJECT_MAX_CARDINALITY '(' INTEGER objectPropertyExpression classExpression ? ')';

objectExactCardinality : OBJECT_EXACT_CARDINALITY '(' INTEGER objectPropertyExpression classExpression? ')';

dataSomeValuesFrom : DATA_SOME_VALUES_FROM '(' dataPropertyExpression dataPropertyExpression* dataRange ')';

dataAllValuesFrom : DATA_ALL_VALUES_FROM '(' dataPropertyExpression dataPropertyExpression* dataRange ')';

dataHasValue : DATA_HAS_VALUE '(' dataPropertyExpression literal ')';

dataMinCardinality : DATA_MIN_CARDINALITY '(' INTEGER dataPropertyExpression dataRange? ')';

dataMaxCardinality : DATA_MAX_CARDINALITY '(' INTEGER dataPropertyExpression dataRange? ')';

dataExactCardinality : DATA_EXACT_CARDINALITY '(' INTEGER dataPropertyExpression dataRange? ')';

dataPropertyExpression : dataProperty;

assertion :
sameIndividual | differentIndividuals | classAssertion |
objectPropertyAssertion | negativeObjectPropertyAssertion |
dataPropertyAssertion | negativeDataPropertyAssertion;

sourceIndividual : individual;
targetIndividual : individual;
targetValue : literal;

sameIndividual : SAME_INDIVIDUAL '(' axiomAnnotations individual individual individual* ')';

differentIndividuals : DIFFERENT_INDIVIDUALS '(' axiomAnnotations individual individual individual* ')';

classAssertion : CLASS_ASSERTION '(' axiomAnnotations classExpression individual ')';

objectPropertyAssertion : OBJECT_PROPERTY_ASSERTION '(' axiomAnnotations objectPropertyExpression sourceIndividual targetIndividual ')';

negativeObjectPropertyAssertion : NEGATIVE_OBJECT_PROPERTY_ASSERTION '(' axiomAnnotations objectPropertyExpression sourceIndividual targetIndividual ')';

dataPropertyAssertion : DATA_PROPERTY_ASSERTION '(' axiomAnnotations dataPropertyExpression sourceIndividual targetValue ')';

negativeDataPropertyAssertion : NEGATIVE_DATA_PROPERTY_ASSERTION '(' axiomAnnotations dataPropertyExpression sourceIndividual targetValue ')' ;

dataRange :
datatype |
dataIntersectionOf |
dataUnionOf |
dataComplementOf |
dataOneOf |
datatypeRestriction ;
dataIntersectionOf : DATA_INTERSECTION_OF '(' dataRange dataRange dataRange* ')' ;
dataUnionOf : DATA_UNION_OF '(' dataRange dataRange dataRange* ')' ;
dataComplementOf : DATA_COMPLEMENT_OF '(' dataRange ')' ;
dataOneOf : DATA_ONE_OF '(' literal literal* ')' ;
datatype : iRI;
objectPropertyExpression : objectProperty | inverseObjectProperty;
inverseObjectProperty : OBJECT_INVERSE_OF '(' objectProperty ')';
datatypeRestriction : DATATYPE_RESTRICTION '(' datatype constrainingFacet restrictionValue ( constrainingFacet restrictionValue)* ')';
constrainingFacet : iRI ;
restrictionValue : literal;
dataProperty:iRI;
individual: namedIndividual | anonymousIndividual;
namedIndividual:iRI;
anonymousIndividual:BLANK_NODE_LABEL;
literal: String ( LANGTAG | xsdIri)? ;
String : STRING_LITERAL1 | STRING_LITERAL2 | STRING_LITERAL_LONG1 | STRING_LITERAL_LONG2 ;
classN:iRI;
objectProperty:iRI;
iRI: IRIREF | prefixedName ;
prefixedName : PNAME_LN | PNAME_NS ;
blankNode : BLANK_NODE_LABEL | ANON ;
xsdIri: '^^' (IRIREF | prefixedName);//PNAME_LN | PNAME_NS;
COMMENT:
('#' .*? ('\r'| '\r\n')) {skip();}
;
IRIREF : '<' (~[\u0000-\u0020<>"{}|^`\\])* '>' ;
PNAME_NS : PN_PREFIX? ':' ;
PNAME_LN : PNAME_NS PN_LOCAL ;
BLANK_NODE_LABEL : '_:' ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)? ;
VAR1 : '?' VARNAME ;
VAR2 : '$' VARNAME ;
LANGTAG : '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)* ;
INTEGER : [0-9]+ ;
DECIMAL : [0-9]* '.' [0-9]+ ;
DOUBLE : [0-9]+ '.' [0-9]* EXPONENT | '.' ([0-9])+ EXPONENT | ([0-9])+ EXPONENT ;
INTEGER_POSITIVE : '+' INTEGER ;
DECIMAL_POSITIVE : '+' DECIMAL ;
DOUBLE_POSITIVE : '+' DOUBLE ;
INTEGER_NEGATIVE : '-' INTEGER ;
DECIMAL_NEGATIVE : '-' DECIMAL ;
DOUBLE_NEGATIVE : '-' DOUBLE ;
fragment EXPONENT : E [+-]? [0-9]+ ;
fragment STRING_LITERAL1 : QUOTE1 ( (~[\u0027\u005C\u000A\u000D]) | ECHAR )* QUOTE1 ;
fragment STRING_LITERAL2 : QUOTE2 ( (~[\u0022\u005C\u000A\u000D]) | ECHAR )* QUOTE2 ;
fragment STRING_LITERAL_LONG1 : '\'\'\'' ( ( '\'' | '\'\'' )? ( ~[\'\\] | ECHAR ) )* '\'\'\'' ;
fragment STRING_LITERAL_LONG2 : '"""' ( ( '"' | '""' )? ( ~["\\] | ECHAR ) )* '"""' ;
fragment ECHAR : '\\' [tbnrf\\"'] ;
NIL : '(' WS* ')' ;
WS : ('\u0020' | '\u0009' | '\u000D' | '\u000A') {skip();} ;
ANON : '[' WS* ']' ;

DL_SAFE_RULE:'DLSafeRule';
BODY:'Body';
HEAD:'Head';
DECLARATION:'Declaration';
CLASS:'Class';
DATA_TYPE:'Datatype';
OBJECT_PROPERTY:'ObjectProperty';
DATA_PROPERTY:'DataProperty';
ANNOTATION_PROPERTY:'AnnotationProperty';
NAMED_INDIVIDUAL:'NamedIndividual';
SUB_CLASS_OF:'SubClassOf';
EQUIVALENT_CLASSES:'EquivalentClasses';
DISJOINT_CLASSES:'DisjointClasses';
DISJOINT_UNION:'DisjointUnion';
SUB_OBJECT_PROPERTY_OF:'SubObjectPropertyOf';
OBJECT_PROPERTY_CHAIN:'ObjectPropertyChain';
EQUIVALENT_OBJECT_PROPERTIES:'EquivalentObjectProperties';
DISJOINT_OBJECT_PROPERTIES:'DisjointObjectProperties';
OBJECT_PROPERTY_DOMAIN:'ObjectPropertyDomain';
OBJECT_PROPERTY_RANGE:'ObjectPropertyRange';
INVERSE_OBJECT_PROPERTIES:'InverseObjectProperties';
FUNCTIONAL_OBJECT_PROPERTY:'FunctionalObjectProperty';
INVERSE_FUNCTIONAL_OBJECT_PROPERTY:'InverseFunctionalObjectProperty';
REFLEXIVE_OBJECT_PROPERTY:'ReflexiveObjectProperty';
IRREFLEXIVE_OBJECT_PROPERTY :'IrreflexiveObjectProperty';
SYMMETRIC_OBJECT_PROPERTY:'SymmetricObjectProperty';
ASYMMETRIC_OBJECT_PROPERTY:'AsymmetricObjectProperty';
TRANSITIVE_OBJECT_PROPERTY:'TransitiveObjectProperty';
SUB_DATA_PROPERTY_OF:'SubDataPropertyOf';
EQUIVALENT_DATA_PROPERTIES:'EquivalentDataProperties';
DISJOINT_DATA_PROPERTIES:'DisjointDataProperties';
DATA_PROPERTY_DOMAIN:'DataPropertyDomain';
DATA_PROPERTY_RANGE:'DataPropertyRange';
FUNCTIONAL_DATA_PROPERTY:'FunctionalDataProperty';
DATATYPE_DEFINITION:'DatatypeDefinition';
HAS_KEY:'HasKey';
CLASS_ATOM:'ClassAtom';
DATA_RANGE_ATOM:'DataRangeAtom';
OBJECT_PROPERTY_ATOM:'ObjectPropertyAtom';
DATA_PROPERTY_ATOM:'DataPropertyAtom';
BUILT_IN_ATOM:'BuiltInAtom';
SAME_INDIVIDUAL_ATOM:'SameIndividualAtom';
DIFFERENT_INDIVIDUALS_ATOM:'DifferentIndividualsAtom';
VARIABLE:'Variable';
DESCRIPTION_GRAPH_RULE:'DescriptionGraphRule';
DESCRIPTION_GRAPH:'DescriptionGraph';
NODES:'Nodes';
NODE_ASSERTION:'NodeAssertion';
EDGES:'Edges';
EDGE_ASSERTION:'EdgeAssertion';
MAIN_CLASSES:'MainClasses';
ANNOTATION:'Annotation';
ANNOTATION_ASSERTION:'AnnotationAssertion';
SUB_ANNOTATION_PROPERTY_OF:'SubAnnotationPropertyOf';
ANNOTATION_PROPERTY_DOMAIN:'AnnotationPropertyDomain';
ANNOTATION_PROPERTY_RANGE:'AnnotationPropertyRange';
OBJECT_INTERSECTION_OF:'ObjectIntersectionOf';
OBJECT_UNION_OF:'ObjectUnionOf';
OBJECT_COMPLEMENT_OF:'ObjectComplementOf';
OBJECT_ONE_OF:'ObjectOneOf';
OBJECT_SOME_VALUES_FROM:'ObjectSomeValuesFrom';
OBJECT_ALL_VALUES_FROM:'ObjectAllValuesFrom';
OBJECT_HAS_VALUE:'ObjectHasValue';
OBJECT_HAS_SELF:'ObjectHasSelf';
OBJECT_MIN_CARDINALITY:'ObjectMinCardinality';
OBJECT_MAX_CARDINALITY:'ObjectMaxCardinality';
OBJECT_EXACT_CARDINALITY:'ObjectExactCardinality';
DATA_SOME_VALUES_FROM:'DataSomeValuesFrom';
DATA_ALL_VALUES_FROM:'DataAllValuesFrom';
DATA_HAS_VALUE:'DataHasValue';
DATA_MIN_CARDINALITY:'DataMinCardinality';
DATA_MAX_CARDINALITY:'DataMaxCardinality';
DATA_EXACT_CARDINALITY:'DataExactCardinality';
SAME_INDIVIDUAL:'SameIndividual';
DIFFERENT_INDIVIDUALS:'DifferentIndividuals';
CLASS_ASSERTION:'ClassAssertion';
OBJECT_PROPERTY_ASSERTION:'ObjectPropertyAssertion';
NEGATIVE_OBJECT_PROPERTY_ASSERTION:'NegativeObjectPropertyAssertion';
DATA_PROPERTY_ASSERTION:'DataPropertyAssertion';
NEGATIVE_DATA_PROPERTY_ASSERTION:'NegativeDataPropertyAssertion';
DATA_INTERSECTION_OF:'DataIntersectionOf';
DATA_UNION_OF:'DataUnionOf';
DATA_COMPLEMENT_OF:'DataComplementOf';
DATA_ONE_OF:'DataOneOf';
OBJECT_INVERSE_OF:'ObjectInverseOf';
DATATYPE_RESTRICTION:'DatatypeRestriction';

fragment PN_CHARS_BASE : (A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z) | [\u00C0-\u00D6] | [\u00D8-\u00F6] | [\u00F8-\u02FF] | [\u0370-\u037D] | [\u037F-\u1FFF] | [\u200C-\u200D] | [\u2070-\u218F] | [\u2C00-\u2FEF] | [\u3001-\uD7FF] | [\uF900-\uFDCF] | [\uFDF0-\uFFFD];// | [\u10000-\uEFFFF] ;
fragment PN_CHARS_U : PN_CHARS_BASE | '_' ;
fragment VARNAME : ( PN_CHARS_U | [0-9] ) ( PN_CHARS_U | [0-9] | '\u00B7' | [\u0300-\u036F] | [\u203F-\u2040] )* ;
fragment PN_CHARS : PN_CHARS_U | '-' | [0-9] | '\u00B7' | [\u0300-\u036F] | [\u203F-\u2040] ;
fragment PN_PREFIX : PN_CHARS_BASE ((PN_CHARS|'.')* PN_CHARS)? ;
fragment PN_LOCAL : (PN_CHARS_U | ':' | [0-9] | PLX ) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX) )? ;
fragment PLX : PERCENT | PN_LOCAL_ESC ;
fragment PERCENT : '%' HEX HEX ;
fragment HEX : [0-9] | (A|B|C|D|E|F) ;
fragment PN_LOCAL_ESC : '\\' ( '_' | '~' | '.' | '-' | '!' | '$' | '&' | '"\'"' | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%' ) ;
fragment QUOTE2:'"';
fragment QUOTE1:'\'';

fragment A:[aA];
fragment B:[bB];
fragment C:[cC];
fragment D:[dD];
fragment E:[eE];
fragment F:[fF];
fragment G:[gG];
fragment H:[hH];
fragment I:[iI];
fragment J:[jJ];
fragment K:[kK];
fragment L:[lL];
fragment M:[mM];
fragment N:[nN];
fragment O:[oO];
fragment P:[pP];
fragment Q:[qQ];
fragment R:[rR];
fragment S:[sS];
fragment T:[tT];
fragment U:[uU];
fragment V:[vV];
fragment W:[wW];
fragment X:[xX];
fragment Y:[yY];
fragment Z:[zZ];
fragment UNDERLINE:'_';

用antlr文法编写的hermit swrl规则(分享)的更多相关文章

  1. 如何编写snort的检测规则

    如何编写snort的检测规则 2013年09月08日 ⁄ 综合 ⁄ 共 16976字 前言 snort是一个强大的轻量级的网络入侵检测系统.它具有实时数据流量分析和日志IP网络数据包的能力,能够进行协 ...

  2. 编写基本的 udev 规则

    来自: https://linux.cn/article-9365-1.html?utm_source=index&utm_medium=more 读者对象 理解 udev 背后的基本概念,学 ...

  3. CentOS 7上编写自定义系统审计规则

    1)简介 Linux审计系统创建审计跟踪,这是一种跟踪系统上各种信息的方法.它可以记录大量数据,如事件类型,日期和时间,用户ID,系统调用,进程,使用的文件,SELinux上下文和敏感度级别.它可以跟 ...

  4. Python3简单登录接口编写及遇到的问题分享

    1.程序目标 输入用户名密码 认证成功后显示欢迎信息 输错三次后锁定 2.思路 利用python中的pickle模块,实现用户登录信息(采用dict)和被锁定用户信息(采用list)的存储.所以我预先 ...

  5. udev规则以及编写

    主要内容: udev简介 如何配置和使用udev 如何编写udev规则 字符串替换和匹配 udev主要作用 编写udev规则实例 难点解析 1. udev简介 1.1 什么是udev? udev是Li ...

  6. ANTLR随笔(一)

    学习背景 最近做项目需要开发一个类似Graphql的简单版的自定义查询功能. 功能主要是通过前端自定义的复查询条件来控制后端的查询字段以及最终返回的JSON格式. 最初准备直接使用Graphql实现但 ...

  7. ANTLR 语法设计

    下面学习如何编写语法. 如何定义语法规则 一种语言模式就是一种递归的语法结构. 我们需要从一系列有代表性的输入文件中归纳出一门语言的结构.在完成这样的归纳工作后,我们就可以正式使用ANTLR语法来表达 ...

  8. 用 Antlr 重构脚本解释器

    前言 在上一个版本实现的脚本解释器 GScript 中实现了基本的四则运算以及 AST 的生成. 当我准备再新增一个 % 取模的运算符时,会发现工作很繁琐而且几乎都是重复的:主要是两步: 需要在词法解 ...

  9. 如何用 ANTLR 4 实现自己的脚本语言?

    ANTLR 是一个 Java 实现的词法/语法分析生成程序,目前最新版本为 4.5.2,支持 Java,C#,JavaScript 等语言,这里我们用 ANTLR 4.5.2 来实现一个自己的脚本语言 ...

随机推荐

  1. ArcEngine查询、添加、删除要素的方法

    原文 ArcEngine查询.添加.删除要素的方法 1.查找数据 1).利用FeaturCursor进行空间查询 //空间查询 ISpatialFilter spatialFilter = new S ...

  2. andorid 进度条

    SeekBar类似于ProgressBar,但是ProgressBar的主要功能是让用户知道目前的状态,而SeekBar的功能在于让用户调整进度,举个例子,在音乐播放器中,可以通过调整SeekBar来 ...

  3. HDU 5607 graph 矩阵快速幂 + 快速幂

    这道题得到了学长的助攻,其实就是一个马尔科夫链,算出一步转移矩阵进行矩阵快速幂就行了,无奈手残 这是我第一回写矩阵快速幂,写的各种毛病,等到调完了已经8点44了,交了一发,返回PE,(发现是少了换行) ...

  4. 【译】 AWK教程指南 7AWK应用实例

    本节将示范一个统计上班到达时间及迟到次数的程序. 这程序每日被执行时将读入两个数据文件: * 员工当日到班时间的数据文件 ( 如下列的 arr.dat ) * 存放员工当月迟到累计次数的文件 当程序执 ...

  5. C++默认参数不能是一个引用

    引用做参数时不能传一个定值(如数字或者const等~~~) somefunc(int& a = 4) -> default argument for ‘int& a’ has t ...

  6. jqgrid在页面出来竖型滚动条自动调整列宽

    在项目中使用jqgrid的时候,需要设置在页面竖型滚动条出来的时候,列宽进行调整 1. 判断jqgrid的宽度是否和页面的宽度不一致(判断滚动条是否出来) 2. 调整jqgrid的列宽,因为jqgri ...

  7. Windows性能监视器之CPU、硬盘、IO等监控方法详解-摘自网络

    一般操作系统性能主要涉及到的问题主要有:处理器使用情况.内存占有量.磁盘I/0操作以及网络流量等. 查看Windows性能情况,大部分情况下是通过 “Windows任务管理器”,可以通过在 ”命令行” ...

  8. Qt Creator编辑器乱问题

    新安装的Qt Creator 打开原来的工程源码时提示:无法用 "UTF-8"-编码解码 "main.cpp". 无法编辑   解决办法:修改项目属性的编辑器设 ...

  9. Oracle- 包

    在一个大型项目中,可能有很多模块,而每个模块又有自己的过程.函数等.而这些过程.函数默认是放在一起的(如在PL/SQL中,过程默认都是放在一起的,即Procedures中),这些非常不方便查询和维护. ...

  10. ios之runtime学习

    今天学习了一下ios的runtime,看了其他博主的博客写的很不错,自己就不班门弄斧了,仅在此转载: 1.关于oc中类和元类:http://husbandman.diandian.com/post/2 ...