@@ -7,6 +7,7 @@ import * as transform from './transform';
77export { code , node , transform , Property , PropertyType , Span } ;
88export { Edge } from './edge' ;
99export { LoopChecker } from './loop-checker' ;
10+ export { ShiftChecker } from './shift-checker' ;
1011export { ISpanAllocatorResult , SpanAllocator } from './span-allocator' ;
1112export { Reachability } from './reachability' ;
1213
@@ -112,6 +113,34 @@ export class Builder {
112113 return new node . Pause ( errorCode , reason ) ;
113114 }
114115
116+ // Shift
117+
118+ /**
119+ * Create a node that packs bits into a field in
120+ * little endian format.
121+ *
122+ * state[field] <<= value;
123+ *
124+ * This node does not provide otherwise as this node must
125+ * consume bytes upon execution.
126+ */
127+ public lshift ( field : string , bits : number ) : node . Shift {
128+ return new node . Shift ( field , bits , true ) ;
129+ }
130+
131+ /**
132+ * Create a node that packs bits into a field in
133+ * big endian format.
134+ *
135+ * state[field] >>= value;
136+ *
137+ * This node does not provide otherwise as this node must
138+ * consume bytes upon execution.
139+ */
140+ public rshift ( field : string , bits : number ) : node . Shift {
141+ return new node . Shift ( field , bits , false ) ;
142+ }
143+
115144 // Span
116145
117146 /**
0 commit comments