C# Класс Loyc.Ecs.EcsPrecedence

Contains Precedence objects that represent the precedence rules of EC#.
Summary:
100+: Primary: x.y x::y f(x) a[i] etc.
90+: Prefix: + - ! ~ ++x --x (T)x
80+: Power: x**y
70+: Mult: * / %
60+: Add: + - (Shift is 56 but ideally would be 70)
50+: Range: .. (`custom operators` are 28 to 55)
40+: Compare: < > <= >= is as using == !=
30+: Bitwise &^| (Ideally would be 54..59)
20+: Conditional && || ^^
10+: Ternary
1: Assignment
-1: Lambda (only the right-hand side of '=>') When printing an expression, we avoid emitting x & y == z because the ranges of == and & overlap. Instead EcsNodePrinter prints #&(x, y == z). Admittedly this is rather ugly, but you can enable the EcsNodePrinter.AllowExtraParenthesis option, which allows parenthesis to be added so that a Loyc tree with the structure #&(x, y == z) is emitted as x & (y == z), even though the latter is a slightly different tree. Most of the operators use a range of two adjacent numbers, e.g. 10..11. This represents a couple of ideas for future use in a compiler that allows you to define new operators; one idea is, you could give new operators the "same" precedence as existing operators, but make them immiscible with those operators... yet still make them miscible with another new operator. For instance, suppose you define two new operators `glob` and `fup` with PrecedenceRange 41..41 and 40..40 respectively. Then neither can be mixed with + and -, but they can be mixed with each other and `fup` has higher precedence. Maybe this is not very useful, but hey, why not? If simply incrementing a number opens up new extensibility features, I'm happy to do it. (I could have used a non-numeric partial ordering system to do the same thing, but it would have been more complex, and of questionable value.)
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
Add Precedence
And Precedence
AndBits Precedence
Assign Precedence
Backtick Precedence
Compare Precedence
Equals Precedence
Forward Precedence
IfElse Precedence
IsAsUsing Precedence
Lambda Precedence
Multiply Precedence
NullDot Precedence
Of Precedence
Or Precedence
OrBits Precedence
OrIfNull Precedence
Power Precedence
Prefix Precedence
Primary Precedence
Range Precedence
Shift Precedence
Substitute Precedence
XorBits Precedence

Описание свойств

Add публичное статическое свойство

public static Precedence Add
Результат Precedence

And публичное статическое свойство

public static Precedence And
Результат Precedence

AndBits публичное статическое свойство

public static Precedence AndBits
Результат Precedence

Assign публичное статическое свойство

public static Precedence Assign
Результат Precedence

Backtick публичное статическое свойство

public static Precedence Backtick
Результат Precedence

Compare публичное статическое свойство

public static Precedence Compare
Результат Precedence

Equals публичное статическое свойство

public static Precedence Equals
Результат Precedence

Forward публичное статическое свойство

public static Precedence Forward
Результат Precedence

IfElse публичное статическое свойство

public static Precedence IfElse
Результат Precedence

IsAsUsing публичное статическое свойство

public static Precedence IsAsUsing
Результат Precedence

Lambda публичное статическое свойство

public static Precedence Lambda
Результат Precedence

Multiply публичное статическое свойство

public static Precedence Multiply
Результат Precedence

NullDot публичное статическое свойство

public static Precedence NullDot
Результат Precedence

Of публичное статическое свойство

public static Precedence Of
Результат Precedence

Or публичное статическое свойство

public static Precedence Or
Результат Precedence

OrBits публичное статическое свойство

public static Precedence OrBits
Результат Precedence

OrIfNull публичное статическое свойство

public static Precedence OrIfNull
Результат Precedence

Power публичное статическое свойство

public static Precedence Power
Результат Precedence

Prefix публичное статическое свойство

public static Precedence Prefix
Результат Precedence

Primary публичное статическое свойство

public static Precedence Primary
Результат Precedence

Range публичное статическое свойство

public static Precedence Range
Результат Precedence

Shift публичное статическое свойство

public static Precedence Shift
Результат Precedence

Substitute публичное статическое свойство

public static Precedence Substitute
Результат Precedence

XorBits публичное статическое свойство

public static Precedence XorBits
Результат Precedence