From a5ec72e1f968e41ae680ca8a48eb6c8a3c6816ec Mon Sep 17 00:00:00 2001 From: arookas Date: Sun, 27 Dec 2015 21:03:38 -0500 Subject: [PATCH] Member field naming convention. --- ssc/ast/nodes.cs | 16 ++++++++-------- ssc/context.cs | 44 ++++++++++++++++++++++---------------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/ssc/ast/nodes.cs b/ssc/ast/nodes.cs index 71de4d4..42d04a8 100644 --- a/ssc/ast/nodes.cs +++ b/ssc/ast/nodes.cs @@ -25,13 +25,13 @@ namespace arookas class sunNode : IEnumerable { - List children; + List mChildren; public sunNode Parent { get; private set; } public sunSourceLocation Location { get; private set; } - public int Count { get { return children.Count; } } - public sunNode this[int index] { get { return index >= 0 && index < Count ? children[index] : null; } } + public int Count { get { return mChildren.Count; } } + public sunNode this[int index] { get { return index >= 0 && index < Count ? mChildren[index] : null; } } public bool IsRoot { get { return Parent == null; } } public bool IsBranch { get { return Count > 0; } } @@ -68,7 +68,7 @@ namespace arookas public sunNode(sunSourceLocation location) { - children = new List(5); + mChildren = new List(5); Location = location; } @@ -83,7 +83,7 @@ namespace arookas node.Parent.Remove(node); } node.Parent = this; - children.Add(node); + mChildren.Add(node); } public void Remove(sunNode node) { @@ -93,7 +93,7 @@ namespace arookas } if (node.Parent == this) { - children.Remove(node); + mChildren.Remove(node); node.Parent = null; } } @@ -103,7 +103,7 @@ namespace arookas { child.Parent = null; } - children.Clear(); + mChildren.Clear(); } public virtual void Compile(sunContext context) @@ -126,7 +126,7 @@ namespace arookas return false; } - public IEnumerator GetEnumerator() { return children.GetEnumerator(); } + public IEnumerator GetEnumerator() { return mChildren.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } diff --git a/ssc/context.cs b/ssc/context.cs index 6101e96..8136550 100644 --- a/ssc/context.cs +++ b/ssc/context.cs @@ -8,9 +8,9 @@ namespace arookas { class sunContext { - aBinaryWriter writer; - uint textOffset, dataOffset, symbolOffset; - int varCount; + aBinaryWriter mWriter; + uint mTextOffset, mDataOffset, mSymbolOffset; + int mVarCount; public sunWriter Text { get; private set; } public sunDataTable DataTable { get; private set; } @@ -47,15 +47,15 @@ namespace arookas Scopes.Clear(); Loops.Clear(); ImportResolver = importResolver; - writer = new aBinaryWriter(output, Endianness.Big, Encoding.GetEncoding(932)); - Text = new sunWriter(writer); - writer.PushAnchor(); + mWriter = new aBinaryWriter(output, Endianness.Big, Encoding.GetEncoding(932)); + Text = new sunWriter(mWriter); + mWriter.PushAnchor(); WriteHeader(); // dummy header // begin text block - textOffset = (uint)writer.Position; - writer.PushAnchor(); // match code offsets and writer offsets + mTextOffset = (uint)mWriter.Position; + mWriter.PushAnchor(); // match code offsets and writer offsets // add system builtins DeclareSystemBuiltin("yield", false); @@ -70,12 +70,12 @@ namespace arookas } public void Close() { - writer.PopAnchor(); - dataOffset = (uint)writer.Position; - DataTable.Write(writer); - symbolOffset = (uint)writer.Position; - SymbolTable.Write(writer); - writer.Goto(0); + mWriter.PopAnchor(); + mDataOffset = (uint)mWriter.Position; + DataTable.Write(mWriter); + mSymbolOffset = (uint)mWriter.Position; + SymbolTable.Write(mWriter); + mWriter.Goto(0); WriteHeader(); } @@ -95,7 +95,7 @@ namespace arookas ImportResolver.EnterFile(file); var parser = new sunParser(); var tree = parser.Parse(file); - varCount += tree.MaxLocalCount; + mVarCount += tree.MaxLocalCount; tree.Compile(this); ImportResolver.ExitFile(file); } @@ -234,13 +234,13 @@ namespace arookas void WriteHeader() { - writer.WriteString("SPCB"); - writer.Write32(textOffset); - writer.Write32(dataOffset); - writer.WriteS32(DataTable.Count); - writer.Write32(symbolOffset); - writer.WriteS32(SymbolTable.Count); - writer.WriteS32(varCount); + mWriter.WriteString("SPCB"); + mWriter.Write32(mTextOffset); + mWriter.Write32(mDataOffset); + mWriter.WriteS32(DataTable.Count); + mWriter.Write32(mSymbolOffset); + mWriter.WriteS32(SymbolTable.Count); + mWriter.WriteS32(mVarCount); } } }