Monday, February 9, 2009

Old "Oslo" samples & new SDK [updated]

I have tried to compile and run Microsoft samples. Some of them don't work with new SDK.  Breaking changes I have detected:

Sample

"Oslo" SDK October 2008 CTP

"Oslo" SDK January 2009 CTP

MGraphXamlReader MWindow
Event Pattern Mesh

System.Dataflow.dll

ErrorReporter: void OnError(ISourceLocation sourceLocation, ErrorInformation errorInformation)
System.Dataflow.dll
ErrorReporter: void OnError(ErrorInformation errorInformation)
class ErrorInformation has new Location property

Practical sample
MGraphXamlReader MWindow
Event Pattern Mesh

System.Dataflow.dll

ErrorInformation: BuildEventArgs ToBuildEventArgs(ISourceLocation sourceLocation, string errorCodePrefix, string senderName)
System.Dataflow.dll
ErrorInformation: BuildEventArgs ToBuildEventArgs(string errorCodePrefix, string senderName)
class ErrorInformation has new Location property


Practical sample
MGraphXamlReader MWindow
Spork

System.Dataflow.dll

ParserBase, TermGraphAdapter:
ParserBase.TermAdapter = new TermGraphAdapter { GraphBuilder = customGraphBuilder };

System.Dataflow.dll

dynamicParser.GraphBuilder = customGraphBuilder;

Practical sample
MGraphXamlReader MWindow
Spork
Event Pattern Mesh

System.Dataflow.dll
DynamicParser: ParserBase: LexerParser  
object ParseObject(TextReader textReader, ErrorReporter errorReporter)
TReturn Parse<TReturn>(TextReader textReader, ErrorReporter errorReporter) where TReturn: class;

parser.ParseObject(reader, errorReporter);

System.Dataflow.dll
DynamicParser:
   
TReturn Parse<TReturn>(string fileName, TextReader textReader, ErrorReporter errorReporter) where TReturn : class;

 

parser.Parse<object>(null, reader,  errorReporter);

Practical sample

Person 
MWindow
Microsoft.M.Grammar.dll
GContentType
Microsoft.M.Grammar.dll
ContentType

Practical sample
MWindow MGrammar:

identifier token IdentifierName = IdentifierBegin IdentifierCharacters?;


token TextLiteral 
      = '"' TextCharacters? '"'
      | '@' '"' TextVerbatimCharacters? '"'
      ;

MGrammar: it helps me:

identifier token IdentifierName = IdentifierBegin | IdentifierBegin IdentifierCharacters;

token TextLiteral 
      = '"' '"' | '"' TextCharacters '"'
      | '@' '"' '"' | '@' '"' TextVerbatimCharacters '"'
      ;


Practical sample

Spork MGrammar:  @{CaseSensitive[false]} MGrammar:  @{CaseInsensitive}

Practical sample

Spork

Microsoft.M.Grammar.dll MGrammarCompiler.GenerateM(successor,  new TermGraphAdapter { GraphBuilder = customGraphBuilder },
"Spork",  new IndentedTextWriter(writer));

custom "M" generation, for example: GenerateM(successor, customGraphBuilder, "Spork", new IndentedTextWriter(writer));

Practical sample

Spork Microsoft.M.Grammar.dll
MGrammarCompiler.LoadParserFromMgx(stream, MparserName);
System.Dataflow.dll
DynamicParser.LoadFromMgx(stream, MparserName);

Practical sample
Event Pattern Mesh Microsoft.M.Grammar.dll
MGrammarCompiler.LoadParserFromMgx("EPML.mg.mgx", "EventPatternMesh.EventPatternModelingLanguage")
System.Dataflow.dll
DynamicParser.LoadFromMgx("EPML.mg.mgx", "EventPatternMesh.Event PatternModelingLanguage");
Spork Microsoft.Intellipad.Core.dll
ImmediateModeEdit:
ImmediateModeEdit CreateEdit(IntelliBuffer buffer, BufferView bufferView, ComponentDomain domain)
Microsoft.Intellipad.Core.dll
ImmediateModeEdit:
ImmediateModeEdit CreateEdit(IntelliBuffer buffer, BufferView bufferView, ComponentDomain domain, bool addCarriageReturnOnExecute);

Practical sample

1 comment:

andrea chiu said...


Good day. I was very impressed with your wonderful article. I hope you can write more and inspire a lot of people . You can also visit my site if you have time. Thank you and Bless you always.

triciajoy.com

www.triciajoy.com