1: doctype public "-//IDN etl.sf.net//ETL//Grammar 0.2.1";
     2: /// This is an expression grammar is imported from main grammars
     3: /// In its turn, this grammar imports main grammar.
     4: grammar net.sf.etl.tests.data.imports.ExpressionGrammar {
     5: 	namespace default i = "http://etl.sf.net/2006/samples/imports/Expression/0.1";
     6: 	import main = "MainGrammar.g.etl";
     7: 	
     8: 	context Expressions {
     9: 		import statements = Statements from main;
    10: 		
    11: 		op composite BlockExpression(f) {
    12: 			@ content += block(statements);
    13: 		};
    14: 
    15: 		op composite Identifier(f) {
    16: 			@ name = identifier;
    17: 		};
    18: 
    19: 		op composite IntegerLiteral(f) {
    20: 			@ value = integer;
    21: 		};
    22: 
    23: 		// priority = 200 below, it here just to check if based number 
    24: 		// works.
    25: 		op UnaryMinusOp(fy,16#C8#,-) {
    26: 			@ value =right;
    27: 		};
    28: 		
    29: 		op UnaryPlusOp(fy,200,+) {
    30: 			@ value =right;
    31: 		};
    32: 		
    33: 		op MultiplyOp(yfx,400,*) {
    34: 			@ multipliers += left; @ multipliers +=right;
    35: 		};
    36: 		
    37: 		op DivideOp(yfx,400,/) {
    38: 			@ dividend = left; @ divisor=right;
    39: 		};
    40: 		
    41: 		op ReminderOp(yfx,400,%) {
    42: 			@ dividend = left; @ divisor=right;
    43: 		};
    44: 		
    45: 		op PlusOp(yfx,500,+) {
    46: 			@ summands += left; @ summands += right;
    47: 		};
    48: 		
    49: 		op MinusOp(yfx,500,-) {
    50: 			@ minuend=left; @ subtrahend=right;
    51: 		};
    52: 	};
    53: };