This commit is contained in:
miks1965 2018-01-06 00:29:19 +03:00
parent 4f1c261f81
commit a08322e1c1
9 changed files with 87 additions and 34 deletions

View file

@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PascalABC.NET Compiler")]
[assembly: AssemblyCopyright("Copyright © 2005-2018 by Ivan Bondarev, Stanislav Mihalkovich")]
[assembly: AssemblyCopyright("Copyright © 2005-2017 by Ivan Bondarev, Stanislav Mihalkovich")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion(RevisionClass.FullVersion)]
@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "3";
public const string Build = "0";
public const string Revision = "1608";
public const string Revision = "1610";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%MINOR%=3
%REVISION%=1608
%REVISION%=1610
%COREVERSION%=0
%MAJOR%=3

View file

@ -1,9 +1,9 @@
//
// This CSharp output file generated by Gardens Point LEX
// Version: 1.1.3.301
// Machine: IVAN-PC
// DateTime: 29.12.2017 22:14:05
// UserName: Ivan
// Machine: DESKTOP-A6LT9RI
// DateTime: 06.01.2018 0:16:05
// UserName: ?????????
// GPLEX input file <ABCPascal.lex>
// GPLEX frame file <embedded resource>
//
@ -2145,6 +2145,11 @@ if (parsertools.build_tree_for_formatter)
{
if (!Defines.Contains(directiveparam))
Defines.Add(directiveparam);
}
else if (directivename == "UNDEF")
{
if (Defines.Contains(directiveparam))
Defines.Remove(directiveparam);
}
break;
case 54:

View file

@ -110,6 +110,11 @@ UNICODEARROW \x890
if (!Defines.Contains(directiveparam))
Defines.Add(directiveparam);
}
else if (directivename == "UNDEF")
{
if (Defines.Contains(directiveparam))
Defines.Remove(directiveparam);
}
}
<EXCLUDETEXT>{OneLineCmnt} {

View file

@ -1,9 +1,9 @@
// (see accompanying GPPGcopyright.rtf)
// GPPG version 1.3.6
// Machine: IVAN-PC
// DateTime: 29.12.2017 22:14:07
// UserName: Ivan
// Machine: DESKTOP-A6LT9RI
// DateTime: 06.01.2018 0:16:05
// UserName: ?????????
// Input file <ABCPascal.y>
// options: no-lines gplex
@ -4035,8 +4035,8 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
case 390: // typed_var_init_expression -> identifier, tkArrow, lambda_function_body
{
var idList = new ident_list(ValueStack[ValueStack.Depth-3].id, LocationStack[LocationStack.Depth-3]);
var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]);
CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan);
var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-3]), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]);
CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-3]), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan);
}
break;
case 391: // typed_var_init_expression -> tkRoundOpen, tkRoundClose, lambda_type_ref,
@ -4061,7 +4061,7 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
idList.idents.Add(el.expressions[j] as ident);
}
var any = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null);
var any = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-4]);
var formalPars = new formal_parameters(new typed_parameters(idList, any, parametr_kind.none, null, LocationStack[LocationStack.Depth-4]), LocationStack[LocationStack.Depth-4]);
CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, any, ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan);
@ -5770,8 +5770,8 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
case 800: // func_decl_lambda -> identifier, tkArrow, lambda_function_body
{
var idList = new ident_list(ValueStack[ValueStack.Depth-3].id, LocationStack[LocationStack.Depth-3]);
var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]);
CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan);
var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-3]), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]);
CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-3]), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan);
}
break;
case 801: // func_decl_lambda -> tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype,

View file

@ -184,5 +184,6 @@ script=

View file

@ -1 +1 @@
!define VERSION '3.3.0.1608'
!define VERSION '3.3.0.1610'

View file

@ -79,7 +79,7 @@ type
procedure SetText(t: string) := b.Text := t;
public
event Click: procedure;
constructor Create(text: string);
constructor Create(text: string := '');
property Width: integer read GetW write SetW;
property Text: string read GetText write SetText;
end;

View file

@ -1617,22 +1617,67 @@ type
function Clone := (inherited Clone) as RectangleT;
end;
FileModelT = class(Object3D)
FileModelT = class(ObjectWithChildren3D)
private
fn: string;
procedure SetMP(mat: GMaterial) := (model as MeshVisual3D).FaceMaterial := mat;
procedure SetMaterial(mat: GMaterial) := Invoke(SetMP, mat);
function GetMaterial: GMaterial := Invoke&<GMaterial>(()->(model as MeshVisual3D).FaceMaterial);
public
//property Color: GColor write SetColor;
property Material: GMaterial read GetMaterial write SetMaterial; // не работает почему-то на запись
{procedure SetVP(v: boolean) := (model as FileModelVisual3D).Visibility := v;
procedure SetV(v: boolean) := Invoke(SetVP, v);
function GetV: boolean := Invoke&<boolean>(()->(model as FileModelVisual3D).Visibility);}
protected
function CreateObject: Object3D; override := new FileModelT(X, Y, Z, (model as FileModelVisual3D).Source);
function CreateObject: Object3D; override := new FileModelT(X, Y, Z, fn, Material.Clone);
public
constructor(x, y, z: real; fname: string);
constructor(x, y, z: real; fname: string; mat: GMaterial);
begin
var a := new FileModelVisual3D;
a.Source := fname;
CreateBase0(a, x, y, z);
model := new MeshVisual3D();
var fs := System.IO.File.OpenRead(fname);
fn := fname;
var ext := System.IO.Path.GetExtension(fname);
ext := ext?.ToLower;
var r: ModelReader;
case ext of
'.off': begin
r := new offreader(nil);
(model as MeshVisual3D).FaceMaterial := mat;
(model as MeshVisual3D).EdgeDiameter := 0;
(model as MeshVisual3D).VertexRadius := 0;
end;
'.3ds': r := new studioreader(nil);
'.lwo': r := new lworeader(nil);
'.stl': r := new stlreader(nil);
'.obj','.objx': r := new objreader(nil);
end;
r.DefaultMaterial := mat;
//r.DefaultMaterial := Colors.Gray;
if ext = '.off' then
begin
(r as offreader).Load(fs);
(model as MeshVisual3D).Mesh := (r as offreader).CreateMesh;
end
else
begin
var md := r.Read(fs);
(model as MeshVisual3D).Content := md;
end;
fs.Close;
{var a := new FileModelVisual3D;
a.Source := fname;}
CreateBase0(model, x, y, z);
end;
//property Visible: boolean read GetV write SetV;
function Clone := (inherited Clone) as FileModelT;
end;
@ -2430,16 +2475,16 @@ function Text3D(p: Point3D; text: string; height: real; c: Color) := Text3D(p.x,
function Text3D(x, y, z: real; text: string; height: real) := Text3D(x, y, z, text, height, 'Arial', Colors.Black);
function Text3D(p: Point3D; text: string; height: real) := Text3D(p.x, p.y, p.z, text, height, 'Arial', Colors.Black);
function Rectangle3D(x, y, z, l, w: real; normal, lendirection: Vector3D; c: Material) := Invoke&<RectangleT>(()->RectangleT.Create(x, y, z, l, w, normal, lendirection, c));
function Rectangle3D(p: Point3D; l, w: real; normal, lendirection: Vector3D; c: Material) := Rectangle3D(p.x, p.y, p.z, l, w, normal, lendirection, c);
function Rectangle3D(x, y, z, l, w: real; normal: Vector3D; c: Material) := Rectangle3D(x, y, z, l, w, normal, OrtX, c);
function Rectangle3D(x, y, z, l, w: real; c: Material) := Rectangle3D(x, y, z, l, w, OrtZ, OrtX, c);
function Rectangle3D(p: Point3D; l, w: real; normal: Vector3D; c: Material) := Rectangle3D(p.x, p.y, p.z, l, w, normal, OrtX, c);
function Rectangle3D(p: Point3D; l, w: real; c: Material) := Rectangle3D(p.x, p.y, p.z, l, w, OrtZ, OrtX, c);
function Rectangle3D(x, y, z, l, w: real; normal, lendirection: Vector3D; c: Material): RectangleT := Invoke&<RectangleT>(()->RectangleT.Create(x, y, z, l, w, normal, lendirection, c));
function Rectangle3D(p: Point3D; l, w: real; normal, lendirection: Vector3D; c: Material): RectangleT := Rectangle3D(p.x, p.y, p.z, l, w, normal, lendirection, c);
function Rectangle3D(x, y, z, l, w: real; normal: Vector3D; c: Material): RectangleT := Rectangle3D(x, y, z, l, w, normal, OrtX, c);
function Rectangle3D(x, y, z, l, w: real; c: Material): RectangleT := Rectangle3D(x, y, z, l, w, OrtZ, OrtX, c);
function Rectangle3D(p: Point3D; l, w: real; normal: Vector3D; c: Material): RectangleT := Rectangle3D(p.x, p.y, p.z, l, w, normal, OrtX, c);
function Rectangle3D(p: Point3D; l, w: real; c: Material): RectangleT := Rectangle3D(p.x, p.y, p.z, l, w, OrtZ, OrtX, c);
/// Загружает модель из файла .obj, .3ds, .lwo, .objz, .stl, .off
function FileModel3D(x, y, z: real; fname: string) := Invoke&<FileModelT>(()->FileModelT.Create(x, y, z, fname));
function FileModel3D(p: Point3D; fname: string) := FileModel3D(p.x, p.y, p.z, fname);
function FileModel3D(x, y, z: real; fname: string; c: Material): FileModelT := Invoke&<FileModelT>(()->FileModelT.Create(x, y, z, fname, c));
function FileModel3D(p: Point3D; fname: string; c: Material): FileModelT := FileModel3D(p.x, p.y, p.z, fname, c);
function Prism(x, y, z: real; Sides: integer; Radius, Height: real; c: Material): PrismT := Invoke&<PrismT>(()->PrismT.Create(x, y, z, Sides, Radius, Height, c));
function Prism(p: Point3D; Sides: integer; Radius, Height: real; c: Material): PrismT := Prism(p.X, p.Y, p.Z, Sides, Radius, Height, c);
@ -2525,9 +2570,6 @@ begin
var s := System.IO.File.OpenRead('boxcube.off');
off.Load(s);
//var mmm := new ModelVisual3D;
//mmm.Model := off.CreateMeshGeometry3D;
var m1 := new MeshVisual3D();
m1.FaceMaterial := Colors.Green;
m1.EdgeDiameter := 0;