Member field naming convention.

This commit is contained in:
arookas 2015-12-27 21:03:38 -05:00
parent 063a092730
commit a5ec72e1f9
2 changed files with 30 additions and 30 deletions

View file

@ -25,13 +25,13 @@ namespace arookas
class sunNode : IEnumerable<sunNode> class sunNode : IEnumerable<sunNode>
{ {
List<sunNode> children; List<sunNode> mChildren;
public sunNode Parent { get; private set; } public sunNode Parent { get; private set; }
public sunSourceLocation Location { get; private set; } public sunSourceLocation Location { get; private set; }
public int Count { get { return children.Count; } } public int Count { get { return mChildren.Count; } }
public sunNode this[int index] { get { return index >= 0 && index < Count ? children[index] : null; } } public sunNode this[int index] { get { return index >= 0 && index < Count ? mChildren[index] : null; } }
public bool IsRoot { get { return Parent == null; } } public bool IsRoot { get { return Parent == null; } }
public bool IsBranch { get { return Count > 0; } } public bool IsBranch { get { return Count > 0; } }
@ -68,7 +68,7 @@ namespace arookas
public sunNode(sunSourceLocation location) public sunNode(sunSourceLocation location)
{ {
children = new List<sunNode>(5); mChildren = new List<sunNode>(5);
Location = location; Location = location;
} }
@ -83,7 +83,7 @@ namespace arookas
node.Parent.Remove(node); node.Parent.Remove(node);
} }
node.Parent = this; node.Parent = this;
children.Add(node); mChildren.Add(node);
} }
public void Remove(sunNode node) public void Remove(sunNode node)
{ {
@ -93,7 +93,7 @@ namespace arookas
} }
if (node.Parent == this) if (node.Parent == this)
{ {
children.Remove(node); mChildren.Remove(node);
node.Parent = null; node.Parent = null;
} }
} }
@ -103,7 +103,7 @@ namespace arookas
{ {
child.Parent = null; child.Parent = null;
} }
children.Clear(); mChildren.Clear();
} }
public virtual void Compile(sunContext context) public virtual void Compile(sunContext context)
@ -126,7 +126,7 @@ namespace arookas
return false; return false;
} }
public IEnumerator<sunNode> GetEnumerator() { return children.GetEnumerator(); } public IEnumerator<sunNode> GetEnumerator() { return mChildren.GetEnumerator(); }
IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }
} }

View file

@ -8,9 +8,9 @@ namespace arookas
{ {
class sunContext class sunContext
{ {
aBinaryWriter writer; aBinaryWriter mWriter;
uint textOffset, dataOffset, symbolOffset; uint mTextOffset, mDataOffset, mSymbolOffset;
int varCount; int mVarCount;
public sunWriter Text { get; private set; } public sunWriter Text { get; private set; }
public sunDataTable DataTable { get; private set; } public sunDataTable DataTable { get; private set; }
@ -47,15 +47,15 @@ namespace arookas
Scopes.Clear(); Scopes.Clear();
Loops.Clear(); Loops.Clear();
ImportResolver = importResolver; ImportResolver = importResolver;
writer = new aBinaryWriter(output, Endianness.Big, Encoding.GetEncoding(932)); mWriter = new aBinaryWriter(output, Endianness.Big, Encoding.GetEncoding(932));
Text = new sunWriter(writer); Text = new sunWriter(mWriter);
writer.PushAnchor(); mWriter.PushAnchor();
WriteHeader(); // dummy header WriteHeader(); // dummy header
// begin text block // begin text block
textOffset = (uint)writer.Position; mTextOffset = (uint)mWriter.Position;
writer.PushAnchor(); // match code offsets and writer offsets mWriter.PushAnchor(); // match code offsets and writer offsets
// add system builtins // add system builtins
DeclareSystemBuiltin("yield", false); DeclareSystemBuiltin("yield", false);
@ -70,12 +70,12 @@ namespace arookas
} }
public void Close() public void Close()
{ {
writer.PopAnchor(); mWriter.PopAnchor();
dataOffset = (uint)writer.Position; mDataOffset = (uint)mWriter.Position;
DataTable.Write(writer); DataTable.Write(mWriter);
symbolOffset = (uint)writer.Position; mSymbolOffset = (uint)mWriter.Position;
SymbolTable.Write(writer); SymbolTable.Write(mWriter);
writer.Goto(0); mWriter.Goto(0);
WriteHeader(); WriteHeader();
} }
@ -95,7 +95,7 @@ namespace arookas
ImportResolver.EnterFile(file); ImportResolver.EnterFile(file);
var parser = new sunParser(); var parser = new sunParser();
var tree = parser.Parse(file); var tree = parser.Parse(file);
varCount += tree.MaxLocalCount; mVarCount += tree.MaxLocalCount;
tree.Compile(this); tree.Compile(this);
ImportResolver.ExitFile(file); ImportResolver.ExitFile(file);
} }
@ -234,13 +234,13 @@ namespace arookas
void WriteHeader() void WriteHeader()
{ {
writer.WriteString("SPCB"); mWriter.WriteString("SPCB");
writer.Write32(textOffset); mWriter.Write32(mTextOffset);
writer.Write32(dataOffset); mWriter.Write32(mDataOffset);
writer.WriteS32(DataTable.Count); mWriter.WriteS32(DataTable.Count);
writer.Write32(symbolOffset); mWriter.Write32(mSymbolOffset);
writer.WriteS32(SymbolTable.Count); mWriter.WriteS32(SymbolTable.Count);
writer.WriteS32(varCount); mWriter.WriteS32(mVarCount);
} }
} }
} }