63 }
else if (label[0] ==
'/') {
66 }
else if ((label[0] ==
'.') && (label[1] ==
'/')) {
69 }
else if ((label[0] ==
'.') && (label[1] ==
'.') && (label[2] ==
'/')) {
72 }
else if (label[1] ==
':') {
76 while ((label[i] != 0) && (label[i] !=
'/')) {
77 s.push_back(label[i]);
80 if (label[i] ==
'/') i++;
114 assert(
isNil(relpath));
125 return cons(label, path);
static Tree label2path(const char *label)
Analyzes a label and converts it as a path.
static Tree encodeName(char g, const string &name)
analyze name for "H:name" | "V:name" etc
Sym PATHROOT
Grammar for labels with pathnames
bool isPathParent(Tree t)
Tree cons(Tree a, Tree b)
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
const Node & node() const
return the content of the tree
bool isSym(const Node &n)
const char * name(Symbol *sym)
Returns the name of a symbol.
static Tree normalizeLabel(Tree label, Tree path)
Symbols are unique objects with a name stored in a hash table.
bool isTree(const Tree &t, const Node &n)
Symbol * symbol(const char *str)
Returns (and creates if new) the symbol of name str.
Tree normalizePath(Tree path)
static Tree concatPath(Tree relpath, Tree abspath)
Concatenate the relative path to the absolute path Note that the relpath is top-down while the abspat...
bool isPathCurrent(Tree t)