Commit 244a10fe authored by Denis Budyak's avatar Denis Budyak

Оно скомпилировалось

parent 987a08fc
......@@ -10,8 +10,8 @@ CONST
квоСерийКлючевыхСлов = 3;
(* system flag names *)
StringWinAPI = "WINAPI";
StringC = "C";
StringWinAPI* = "WINAPI"; (* также используется как значение опции компилятора *)
StringC* = "C"; (* также используется как значение опции компилятора *)
StringPlatformCC = "PlatformCC";
StringMovable = "MOVABLE";
(* StringUntraced = "UNTRACED"; *)
......@@ -223,7 +223,7 @@ VAR
, NameChannelWidth-, NameChannelDepth-, NameVector-, NameFloatingPoint-, NameNoMul-,NameNonBlockingIO-, NameTRM-, NameTRMS-, NameEngine-, NameFinal-, NameAbstract-,
NameBackend-, NameRuntime-, NameFrequencyDivider-, NameRegister-,NameNoReturn-,NamePlain-,NameUnsafe-,NameDisposable-,NameUnchecked-,NameUncooperative- *): SyntaxTree.Identifier;
NameChannelModule- : SyntaxTree.Identifier;
IdentifierChannelModule-, IdentifierEngine- : SyntaxTree.Identifier;
NameGlobal-, Nameglobal: SyntaxTree.Identifier;
identifiers: ARRAY квоСерийКлючевыхСлов OF ARRAY end OF SyntaxTree.Identifier;
......@@ -1651,7 +1651,7 @@ TYPE
RETURN distance
END BasicTypeDistance;
PROCEDURE GetIdentifier*(symbol: SIGNED32; case: Scanner.ВариантыПеревода): SyntaxTree.Identifier;
PROCEDURE GetIdentifier*(symbol: SyntaxTree.ИндВТаблИдент; case: Scanner.ВариантыПеревода): SyntaxTree.Identifier;
BEGIN
IF (symbol >= 0) & (symbol < LEN(identifiers,1)) THEN
RETURN identifiers[Scanner.ORDв(case),symbol]
......@@ -1837,7 +1837,8 @@ TYPE
NameGlobal := SyntaxTree.NewIdentifier("@GLOBAL");
Nameglobal := SyntaxTree.NewIdentifier("@global");
NameChannelModule := SyntaxTree.NewIdentifier(StringChannelModule);
IdentifierChannelModule := SyntaxTree.NewIdentifier(StringChannelModule);
IdentifierEngine := SyntaxTree.NewIdentifier(StringEngine);
(* types *)
Signed8 := SyntaxTree.NewIntegerType(8, TRUE);
......
......@@ -242,8 +242,8 @@ TYPE
BEGIN
IF backend.cellsAreObjects THEN meta.CheckTypeDeclaration(x) END;
capabilities := {};
IF HasFlag(x.modifiers, Global.StringFloatingPoint) THEN INCL(capabilities, Global.FloatingPointCapability) END;
IF HasFlag(x.modifiers, Global.StringVector) THEN INCL(capabilities, Global.VectorCapability) END;
IF HasFlag(x.modifiers, Global.NameFloatingPoint) THEN INCL(capabilities, Global.FloatingPointCapability) END;
IF HasFlag(x.modifiers, Global.NameVector) THEN INCL(capabilities, Global.VectorCapability) END;
backend.SetCapabilities(capabilities);
IF ~implementationEmitter.checker.SkipImplementation(x) THEN
......@@ -561,11 +561,11 @@ TYPE
RETURN result;
END CheckIntegerValue;
PROCEDURE HasValue(modifiers: SyntaxTree.Modifier; CONST name: ARRAY OF CHAR; VAR value: Basic.Integer): BOOLEAN;
PROCEDURE HasValue(modifiers: SyntaxTree.Modifier; ивти: SyntaxTree.ИндВТаблИдент; VAR value: Basic.Integer): BOOLEAN;
VAR this: SyntaxTree.Modifier; id: SyntaxTree.Identifier;
BEGIN
this := modifiers; id := SyntaxTree.NewIdentifier(name);
WHILE (this # NIL) & (this.identifier.и # id.и) DO
this := modifiers;
WHILE (this # NIL) & (this.индексФлагаВТаблицеИдентификаторов # ивти) DO
this := this.nextModifier;
END;
IF this # NIL THEN
......@@ -616,7 +616,7 @@ TYPE
ELSIF (scope.outerScope IS SyntaxTree.CellScope) & (x = scope.outerScope(SyntaxTree.CellScope).bodyProcedure) THEN
inline := FALSE;
cellType := scope.outerScope(SyntaxTree.CellScope).ownerCell;
IF ~HasValue(cellType.modifiers,Global.StringDataMemorySize,memorySize) THEN memorySize := DefaultDataMemorySize END;
IF ~HasValue(cellType.modifiers,Global.NameDataMemorySize,memorySize) THEN memorySize := DefaultDataMemorySize END;
AddBodyCallStub(x);
AddStackAllocation(x,memorySize);
ir := implementationEmitter.NewSection(module.allSections,Sections.BodyCodeSection, name,x,dump);
......@@ -8186,7 +8186,7 @@ TYPE
(* push cellnet boolean *)
PushConstBoolean(baseType(SyntaxTree.CellType).isCellNet);
(* push engine boolean *)
PushConstBoolean(baseType(SyntaxTree.CellType).FindProperty(Global.NameEngine) # NIL);
PushConstBoolean(baseType(SyntaxTree.CellType).FindProperty(Global.IdentifierEngine) # NIL);
(* allocate *)
CallThis(position,"ActiveCellsRuntime","Allocate",7);
......@@ -14143,11 +14143,11 @@ TYPE
statCoopTraceModule)
END Statistics;
PROCEDURE HasFlag(modifiers: SyntaxTree.Modifier; CONST name: ARRAY OF CHAR): BOOLEAN;
VAR this: SyntaxTree.Modifier; id: SyntaxTree.Identifier;
PROCEDURE HasFlag(modifiers: SyntaxTree.Modifier; индВТаблIdent: SyntaxTree.ИндВТаблИдент): BOOLEAN;
VAR this: SyntaxTree.Modifier;
BEGIN
this := modifiers; id := SyntaxTree.NewIdentifier(name);
WHILE (this # NIL) & (this.identifier.и # id.и) DO
this := modifiers;
WHILE (this # NIL) & (this.индексФлагаВТаблицеИдентификаторов # индВТаблIdent) DO
this := this.nextModifier;
END;
RETURN this # NIL
......
......@@ -407,11 +407,12 @@ TYPE
END;
END VisitRecordType;
PROCEDURE Flag(identifier: SyntaxTree.Identifier; VAR first: BOOLEAN);
VAR name: SyntaxTree.IdentifierString;
PROCEDURE Flag(ивти: SyntaxTree.ИндВТаблИдент; VAR first: BOOLEAN);
VAR name: SyntaxTree.IdentifierString; identifier: SyntaxTree.Identifier;
BEGIN
IF first THEN w.String("{") ELSE w.String(", ") END;
first := FALSE;
identifier := Global.GetIdentifier(ивти,printCase);
Basic.GetString(identifier.и,name);
w.String(name);
END Flag;
......@@ -421,7 +422,7 @@ TYPE
IF ~first THEN w.String("} ") END;
END FlagEnd;
PROCEDURE Value(identifier: SyntaxTree.Identifier; value: SIGNED64; VAR first: BOOLEAN);
PROCEDURE Value(identifier: SyntaxTree.ИндВТаблИдент; value: SIGNED64; VAR first: BOOLEAN);
BEGIN
Flag(identifier,first);
w.String("("); w.Int(value,1); w.String(")");
......@@ -444,7 +445,7 @@ TYPE
ELSIF x.callingConvention = SyntaxTree.PlatformCallingConvention THEN
Flag(Global.NamePlatformCC,first)
END;
IF x.stackAlignment > 1 THEN Value(Global.NameStackAligned,x.stackAlignment,first) END;
IF x.stackAlignment > 1 THEN Value(Global.NameAlignStack,x.stackAlignment,first) END;
IF ~first THEN w.String("}") END;
IF (x.modifiers # NIL) & info THEN
......@@ -1250,7 +1251,7 @@ TYPE
type := x.type(SyntaxTree.ProcedureType);
first := TRUE;
IF type.stackAlignment > 1 THEN Value(Global.NameStackAligned,type.stackAlignment,first) END;
IF type.stackAlignment > 1 THEN Value(Global.NameAlignStack,type.stackAlignment,first) END;
IF (type.isRealtime) THEN Flag(Global.NameRealtime,first) END;
IF (type.noReturn) THEN Flag(Global.NameNoReturn,first) END;
IF (x.isAbstract) THEN Flag(Global.NameAbstract,first) END;
......
......@@ -5564,7 +5564,7 @@ TYPE
activeCellsStatement := TRUE;
(* --------- RECEIVE ---------*)
ELSIF (id = Global.Receive) & CheckArity(2,3) THEN
IF ~cellsAreObjects THEN ImportModule(Global.NameChannelModule,position) END;
IF ~cellsAreObjects THEN ImportModule(Global.IdentifierChannelModule,position) END;
IF CheckPortType(parameter0,inPort) & CheckVariable(parameter1) THEN
IF inPort.direction # SyntaxTree.InPort THEN
Error(parameter0.position,"not an in-port")
......@@ -5579,7 +5579,7 @@ TYPE
END;
(* --------- SEND ---------*)
ELSIF (id = Global.Send) & CheckArity(2,2) THEN
IF ~cellsAreObjects THEN ImportModule(Global.NameChannelModule,position) END;
IF ~cellsAreObjects THEN ImportModule(Global.IdentifierChannelModule,position) END;
IF CheckPortType(parameter0,outPort) THEN
IF outPort.direction # SyntaxTree.OutPort THEN
Error(parameter1.position,"not an out-port")
......@@ -7105,7 +7105,7 @@ TYPE
RETURN SyntaxTree.NewProcedureCallStatement(communication.position, FALSE, procedureCallDesignator, communication.outer);
ELSE
IF ~cellsAreObjects THEN ImportModule(Global.NameChannelModule,communication.position) END;
IF ~cellsAreObjects THEN ImportModule(Global.IdentifierChannelModule,communication.position) END;
IF (left = SyntaxTree.invalidDesignator) OR (right = SyntaxTree.invalidExpression) THEN
(* error already handled *)
......
......@@ -4061,7 +4061,7 @@ TYPE
VAR
identifier-: Identifier; expression-: Expression;
resolved-: BOOLEAN;
индексФлагаВТаблицеИдентификаторов*: SIGNED32;
индексФлагаВТаблицеИдентификаторов*: ИндВТаблИдент;
nextModifier-: Modifier;
position-: Position;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment