Nuva

Nuva语言是一种面向对象的动态脚本语言。Nuva对应汉语的「女娲」（中国上古时代的神话传说人物）一词。
设计目的.
设计目的是用于基于模板的代码生成。除了用于代码生成领域外，也能用于开发应用程序，如文本和数据处理、GUI应用程序等。
特点.
&lt;syntaxhighlight&gt;
 if (a = b &amp;&amp; c == d or e &lt;&gt; f)
 ?? foo()
 function foo()
 Result = 'foo'
 end function
 end if
&lt;/syntaxhighlight&gt;
&lt;syntaxhighlight&gt;
 var a = '1'
 a ++
 ?? 'a' ~ a
 // 结果为: a2
&lt;/syntaxhighlight&gt;
 &lt;syntaxhighlight&gt;[.='Hello, Nuva!'.]&lt;/syntaxhighlight&gt;
 &lt;syntaxhighlight&gt;&lt;.='Hello, Nuva!'.&gt;&lt;/syntaxhighlight&gt;
 &lt;syntaxhighlight&gt;[.='Hello, Nuva!'.&gt;&lt;/syntaxhighlight&gt;
 &lt;syntaxhighlight&gt;&lt;.='Hello, Nuva!'.]&lt;/syntaxhighlight&gt;
Nuva虚拟机特点.
&lt;syntaxhighlight&gt;
 var text = System.File.Load('Regex_Test.nuva')
 foreach(str = text.RegexMatchs('\w+', "))
 ?? str
 end foreach
&lt;/syntaxhighlight&gt;
输出如下的结果：
&lt;syntaxhighlight&gt;
 var
 text
 System
 File
 Load
 Regex_Test
 nuva
 foreach
 str
 text
 RegexMatches
 w
 str
 end
 foreach
&lt;/syntaxhighlight&gt;
代码示例.
Hello, Nuva!
&lt;syntaxhighlight&gt;
 &lt;.. "Hello, Nuva!" Demo ..&gt;
 //======================================
 // Hello, Nuva! (1)
 ?? 'Hello, Nuva!'
 /*======================================
 Hello, Nuva! (2)
 function HelloNuva()
 ?? "Hello, Nuva!";
 end function
 HelloNuva();
 /*======================================
 Hello, Nuva! (3)
 class Nuva()
 function Hello()
 ?? 'Hello, Nuva!';
 end function
 end class
 var n = Nuva();
 n.Hello();
&lt;/syntaxhighlight&gt;
foreach | O/R Mapping.
&lt;syntaxhighlight&gt;
 function Foreach_Demo()
 // Load Schema from a Xml file
 var schema = System.Data.LoadSchema(
 System.Path.ProjectPath ~ '..\Northwind\Northwind.xobject'
 
 ?? 'Tables Order by Name'
 foreach(table = schema.Tables.OrderbyName)
 ?? table.Name
 end foreach
 ?? '---------------------------------'
 ?? 'Tables Filter by Name.Length &lt; 10'
 foreach(table = schema.Tables | table.Name.Length &lt; 10)
 ?? table.Name
 end foreach
 end function
&lt;/syntaxhighlight&gt;
file | 生成文件.
&lt;syntaxhighlight&gt;
 function File_Demo()
 ?? \r\n ~ '--Read file and Output here--'
 file('codeexamples.nuvaproj') end file
 // Read file and write to 'Target', overwrite it if exist
 file('codeexamples.nuvaproj', true)
 Target = 'temp.target'
 end file
 ?? \r\n ~ '--Read file dynamically and Output here--'
 file(")
 FileName = System.Path.ProjectPath ~ 'output\temp.target'
 end file
 // Delete file
 System.File.Delete(System.Path.ProjectPath ~ 'output\temp.target')
 end function
&lt;/syntaxhighlight&gt;
assign | 捕获输出.
&lt;syntaxhighlight&gt;
 function Assign_Demo()
 // 'Result' assigned from the output in the assign statement
 assign(Result).]
 Generate Text ... @[.=System.Now.] ...
 &lt;.end assign
 end function
&lt;/syntaxhighlight&gt;
函数 | 递归调用.
&lt;syntaxhighlight&gt;
 /*--------------------------------------------------------
 Factorial
 function Factorial ( N )
 if (N &lt;= 1)
 Result = 1;
 else
 Result = N * Factorial(N - 1); // Recursion Call
 end if;
 end function;
&lt;/syntaxhighlight&gt;
类 | 多态性.
&lt;syntaxhighlight&gt;
 function Class_Demo()
 class ClassA()
 function Do()
 this.DynDo()
 end function
 function DynDo()
 ?? 'ClassA'
 end function
 end class
 class ClassB = ClassA()
 function DynDo()
 ?? 'ClassB'
 end function
 end class
 var c1 = ClassA()
 var c2 = ClassB()
 c1.Do()
 c2.Do()
 end function
&lt;/syntaxhighlight&gt;