/usr/share/doc/logol/LogolGrammar.txt is in logol 1.6.10-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | /**
* Rules definition
*
*/
rule : definitions? (model|query|NEWLINE)+ EOF;
model: ModelName '(' VARIABLE? (',' VARIABLE )* ')' '==>' view;
ModelName : 'mod' INT ('%'('a'..'z'|'A'..'Z'|'0'..'9')+'%')? ;
view : ( ( (',' | ';' | '|')? ( constrainedEntity[parentId] ) ) )+ ;
query : ModelName '('(VARIABLE)? (',' VARIABLE)* ')' ('.' ModelName '('(VARIABLE)? (',' VARIABLE)* ')')* '==*>' Sequence ('.' sequences)*;
sequences : Sequence | '(' Sequence ('.' Sequence)* ')';
Sequence : 'SEQ' INT ;
SequenceDef : 'SEQ' INT ',' ANY '.fsa' ;
definitions : 'def:' NEWLINE? '{' ((definition NEWLINE)|NEWLINE)* '}' NEWLINE ;
definition : ('matrix' '(' LOWID ',' LOWID ',' matrix ')') | ( 'morphism' '(' LOWID ',' LOWID ',' LOWID ')' );
matrix : '[' INT (',' INT)* ']' ;
constrainedEntity : entity (':' '{' stringConstraints '}')? (':' '{' structConstraints '}')? ;
entity : entityVariable | ModelName '(' VARIABLE? (',' VARIABLE )* ')'
| modifier string
| string
| '!' string
| repeat
| '!external' '(' ANY ',' '[' ANY (',' ANY)* ']' ',' '[' ANY (',' ANY)* ']' ')'
| '(' view ')' ;
entityVariable : stringVariableElement ;
stringVariableElement : modifier? stringVariable ;
modifier : (morphism) | ('$' string);
stringConstraints : stringConstraint (',' stringConstraint )* ;
stringConstraint : '_' VARIABLE
| '?' VARIABLE
| '?' string
| '@' interval
| '/@' interval
| '#' interval
| '!' '@' interval
| '!' '/@' interval
| '!' '#' interval;
structConstraints : structConstraint (',' structConstraint )* ;
structConstraint : '_' VARIABLE
| '?' VARIABLE
| '?' string
| ('$'|'p$') LOWID? interval
| ('/$'|'p/$') interval
| '!' ('$'|'p$') LOWID? interval
| '!' ('/$'|'p/$') interval;
structureValues
: structureValue (',' structureValue);
structureValue
: '?' VARIABLE | '$' intexpression;
morphism : operator string ;
weight : '$' string;
stringVariable : '.*' | ('?'? VARIABLE) ;
repeat: 'repeat(' view (','|';')? interval? ')+' interval? ;
parameters : '_,' interval | '_;' interval ;
operator: '+' | '-';
VARIABLE: ('A'..'Z')+('0'..'9')+ ('%'('a'..'z'|'A'..'Z'|'0'..'9')+'%')?;
string : '"' LOWID '"';
VARID : ('A'..'Z')+;
LOWID : ('a'..'z'|'\-')+;
ID : ('a'..'z'|'A'..'Z')+ ;
INT : ('0'..'9')+ ;
ANY : ('a'..'z'|'A'..'Z'|'0'..'9')+ ;
NEWLINE: '\r'? '\n' ;
WHITESPACE : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+ { $channel = HIDDEN; };
varrefinteger: VARIABLE | '@' VARIABLE | '/@' VARIABLE | '#' VARIABLE | '$' VARIABLE | '/$' VARIABLE | ('?' VARIABLE ('.nboccur' | '.minDistance' | '.maxDistance'));
intexpression: '_' | INT | varrefinteger | (varrefinteger operator INT) | ( INT operator varrefinteger);
interval : ('[' intexpression ',' intexpression ']')| ('[' intexpression ']' ) ;
|