Tuesday, February 24, 2009

New Intellipad ?

Look at Modeling in Text video on Oslo Developer Center.  You can see some interesting things.

I have noticed unknown version of Intellipad with new icon and green selected windows.

Intellipad_0209_1

Intellipad_0209_2

What's more - the machine contains green console "Administrator: oslo build" and "Oslo" command line tools with version 3.0.1721.0.

Intellipad_0209_3

Intellipad_0209_4

Those are just internal builds that Oslo team is still testing (look  here).

Wednesday, February 11, 2009

"MGrammar" XAML Samples with new "Oslo" CTP

I have updated "MGrammar" XAML Samples (three projects: MGraphXamlReader, Person and MWindow). Now they can work with new "Oslo" SDK.  My changes are described here. You can download actualized versions of the samples below:

Tuesday, February 10, 2009

Spork sample: my version compatible with "Oslo" SDK January 2009

I have made my version of  "Spork" sample compatible with new "Oslo" SDK.  This post will be about it.

First, I changed MGrammar attribute from @{CaseSensitive[false]}  to @{CaseInsensitive} (VBA.mg and VBAv2.mg files).

Next, I made changes on VbaCompiler.cs file (the most important changes). You can download it from:

Finally, I little changed AdvRunner and AdvRunnerV2 projects (additional argument in CreateEdit method of ImmediateModeEdit class).

Complete "Spork" sample with all my changes you can download from:

It works for me !

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

Tuesday, February 3, 2009

Changes in new "Oslo" CTP

I have tried to run my "Oslo" applications and samples in "Oslo" January 2009 SDK CTP.  In this post, I want to share some changes I’ve observed.   

Intellipad

  1. new icon :)
  2. menu M ModeSemantic Graph position has been removed
  3. better validation (f.e file with only extents isn't valid)
  4. MScriptMode:  keyword highlighting 

Intellipad January 2009 MMode

Intellipad January 2009 MScriptMode 

 Visual Studio

  1. "M" project: different sample implementation (without explicit extent definition)
  2.  "M" project compilation: invocation of "M" compiler isn't shown

 Visual Studio January 2009

Compile 

 Repository

Some schemas have been renamed: f.e [Document] -> [System.Document],  [Item] -> [Repository].[Item]

 MGrammar

  1. .mgx image:  DynamicParser (XAML) -> DynamicParserFactory (XAML)
  2. API changes:  some methods or classes have been removed or replaced by others, f.e  MGrammarCompiler -> LoadParserFromMgx, DynamicParser -> ParseObject, MGrammarCompiler -> GenerateM, TermGraphAdapter, ParserBase
  3. VS project: compiling to resource  - <MgTarget>MgxResource</MgTarget>
  4. Parsing .NET application: loading parser from Mgx image - changes 

Dynamic Parser Factory

static DynamicParser LoadLanguageFromAssembly(string lang)
{
var dp = DynamicParser.LoadFromResource("ParseNetMeeting", lang);

return dp;
}

static void Parse(string input)
{
DynamicParser language = LoadLanguageFromAssembly("NetCommunity.NM");

object result = language.Parse<object>(input, null, ErrorReporter.Standard);

IGraphBuilder graphBuilder = new GraphBuilder();

foreach (object meeting in graphBuilder.GetSuccessors(result))
{
//Walking MGraph
}
}

More advanced Microsoft samples don't compile f.e MWindow, Person, Spork. I wait for new versions of them ....

Monday, February 2, 2009

"Oslo" SDK January 2009 CTP

In the post I'll write about new "Oslo" CTP.

Last Friday Microsoft has released  "Oslo" SDK January 2009 CTP.  Elements of new SDK and changes are described here.  Some information I have read:

What's New?

Breaking changes:

  • CaseSensitive attribute has been renamed to CaseInsensitive and doesn't require arguments.
  • Repository: some schemas have been renamed,  you can no longer build all the supplied Oslo models using the /t:Repository option

I wait for more information about new CTP.