Inheritance: Unicoen.ProgramGenerators.UnifiedProgramGenerator
Ejemplo n.º 1
0
 public void ParseComment()
 {
     var prog = new JavaProgramGenerator().Generate("class A { } //abc");
     var comment = prog.Comments[0];
     var pos = comment.Position;
     Assert.That(comment.Content, Is.EqualTo("//abc"));
     Assert.That(pos.StartLine, Is.EqualTo(1));
     Assert.That(pos.StartPosition, Is.EqualTo(12));
     Assert.That(pos.EndLine, Is.EqualTo(1));
     Assert.That(pos.EndPosition, Is.EqualTo(17));
 }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            try {
                var inputPath = FixtureUtil.GetInputPath(
                        "Java", "BugPatterns", "NULL_SAMPLE.java");
                var codeObj =
                        new JavaProgramGenerator().GenerateFromFile(inputPath);

                /*Console.WriteLine("{0}: " + idSet.Count(), idName);
                var nulls = codeObj.Descendants<UnifiedNullLiteral>();
                Console.WriteLine("null: " + nulls.Count());*/
            } catch (Exception e) {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 3
0
 static JavaFactory()
 {
     CodeGenerator = new JavaCodeGenerator();
     ProgramGenerator = new JavaProgramGenerator();
 }