-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathProgram.cs
More file actions
65 lines (63 loc) · 2.23 KB
/
Copy pathProgram.cs
File metadata and controls
65 lines (63 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemUtils.Tools;
namespace modelgen
{
class Program
{
static int Main(string[] args)
{
try
{
var x = T4ModelGenTool.ExtractDataFromTextTemplate(@"C:\Projects\c2j\src\cs2java\Java\Ast\JModel2.tt");
var xx = new T4ModelGenTool().Debug(@"C:\Projects\c2j\src\cs2java\Java\Ast\JModel2.tt", "JSharp.Java.Ast");
return 0;
Console.WriteLine("modelgen "+args.NotNull().StringConcat(" "));
var tool = ToolArgsParser.Parse<ModelGenTool>(args);
if (tool.Help)
{
Console.WriteLine(ToolArgsGenerator.GenerateHelp(tool));
return 0;
}
var gen = new ModelGen
{
SourceFilename = tool.SourceFilename,
GenerateEnum = tool.GenerateEnum.GetValueOrDefault(true),
GenerateLinq = tool.GenerateLinq.GetValueOrDefault(true),
GenerateProperties = tool.GenerateProperties.GetValueOrDefault(true),
RootNodeTypeName = tool.RootNodeTypeName,
Namespace = tool.Namespace,
};
if(tool.Using!=null)
gen.Usings.AddRange(tool.Using);
gen.Run();
}
catch (Exception e)
{
Console.WriteLine(e);
return -1;
}
return 0;
//new JModelGenerator
//{
// SourceFilename = @"..\..\CsModel.txt",
// BaseNodeTypeName = "Element",
// GenerateLinq = true,
// Namespace = "JSharp.CSharp",
//}.Run();
//return;
//new JModelGenerator
//{
// SourceFilename = @"..\..\JModel.txt",
// GenerateEnum = true,
// GenerateLinq = true,
// GenerateProperties = true,
// BaseNodeTypeName = "JNode",
// Namespace = "JSharp.Java.Ast"
//}.Run();
}
}
}