可以用二维数组定义,比如:
Rpa 右括号
Xor 异或/或
And 与
Rel 关系运算
Add 加/减
Mul 乘/除
Mns 单目减
Lpa 左括号
type
TGradeTable = array [1..9, 1..9] of Byte;
const
GT: TGradeTable = (
(* Rpa,Xor,And,Not,Rel,Add,Mul,Mns,Lpa*)
(*Rpa*) ( 3, 3, 3, 3, 3, 3, 3, 3, 0),
(*Xor*) ( 3, 3, 1, 1, 1, 1, 1, 1, 1),
(*And*) ( 3, 3, 3, 1, 1, 1, 1, 1, 1),
(*Not*) ( 3, 3, 3, 3, 1, 1, 1, 1, 1),
(*Rel*) ( 3, 3, 3, 3, 3, 1, 1, 1, 1),
(*Add*) ( 3, 3, 3, 3, 3, 3, 1, 1, 1),
(*Mul*) ( 3, 3, 3, 3, 3, 3, 3, 1, 1),
(*Mns*) ( 3, 3, 3, 3, 3, 3, 3, 3, 1),
(*Lpa*) ( 2, 1, 1, 1, 1, 1, 1, 1, 1)
);