]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/common/precedence/Precedence.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / common / precedence / Precedence.java
1 package org.simantics.scl.compiler.common.precedence;
2
3
4 public final class Precedence {
5     public static final Precedence DEFAULT = new Precedence(9, Associativity.NONASSOC);
6     
7     public final int level;
8     public final Associativity associativity;
9
10     public Precedence(int level, Associativity associativity) {
11         this.level = level;
12         this.associativity = associativity;
13     }
14
15     @Override
16     public String toString() {
17         if(associativity == Associativity.LEFT)
18             return "infixl " + level;
19         else if(associativity == Associativity.RIGHT)
20             return "infixr " + level;
21         else
22             return "infix " + level;
23     }
24 }