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

5 comments:

aislinnleondale said...

i must thank you for the efforts you've put in penning this blog. excellent blog post .

www.n8fan.net

lee woo said...

Love it! Very interesting topics, I hope the incoming comments and suggestion are equally positive. Thank you for sharing this information that is actually helpful.


ufgop.org
ufgop.org

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

Cindy Dy said...

I enjoy reading all your post in your blogs. I guess you are a great blogger beacuse you have a lot of comments in your blogs. Keep on posting. Please inspire more people through your post! Fighting!

Bubble
www.gofastek.com

sarah lee said...

I really enjoyed reading your article. I found this as an informative and interesting post, so i think it is very useful and knowledgeable. I would like to thank you for the effort you have made in writing this article.


edupdf.org