예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:SMEIL.Parser.AST.Import"/> class.
 /// </summary>
 /// <param name="token">The source token</param>
 /// <param name="localname">The import name.</param>
 public ImportStatement(ParseToken token, ImportName modulename, Identifier[] sourceNames, Identifier localname)
     : base(token)
 {
     ModuleName  = modulename;
     SourceNames = sourceNames;
     LocalName   = localname;
 }
예제 #2
0
 /// <summary>
 /// Gets the path of a module, given the referencing module's path
 /// </summary>
 /// <param name="sourcefilepath">The path to the source file requesting the import</param>
 /// <param name="name">The module to load</param>
 /// <returns>The module</returns>
 private static string GetModulePath(string sourcefilepath, AST.ImportName name)
 {
     return
         (System.IO.Path.Join(
              System.IO.Path.GetDirectoryName(sourcefilepath),
              string.Join(
                  System.IO.Path.DirectorySeparatorChar.ToString(), name.Name.Select(x => x.Name)
                  ) + ".sme"
              ));
 }